@@ -1,7 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** |
| 7 | 8 | * Event Espresso |
@@ -80,8 +81,9 @@ discard block |
||
| 80 | 81 | |
| 81 | 82 | |
| 82 | 83 | //If there is no event object by now then get out. |
| 83 | - if ( ! $this->_ticket instanceof EE_Ticket ) |
|
| 84 | - return ''; |
|
| 84 | + if ( ! $this->_ticket instanceof EE_Ticket ) { |
|
| 85 | + return ''; |
|
| 86 | + } |
|
| 85 | 87 | |
| 86 | 88 | switch ( $shortcode ) { |
| 87 | 89 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -49,40 +49,40 @@ discard block |
||
| 49 | 49 | '[TICKET_DESCRIPTION]' => __('The description of the ticket', 'event_espresso'), |
| 50 | 50 | '[TICKET_PRICE]' => __('The price of the ticket', 'event_espresso'), |
| 51 | 51 | '[TKT_QTY_PURCHASED]' => __('The total quantity of the current ticket in the list that has been purchased in this transaction', 'event_espresso'), |
| 52 | - '[TKT_USES_*]' => __( 'This attribute based shortcode parses to show the number of uses the ticket has. The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite. Options are:', 'event_espresso' ) . |
|
| 53 | - '<p><ul>' . |
|
| 54 | - '<li><strong>symbol</strong>:' . __('This returns the ∞ symbol.', 'event_espresso') . '</li>' . |
|
| 55 | - '<li><strong>text</strong>:' . __('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso' ) . '</li>' . |
|
| 56 | - '<li><strong>{custom}</strong>:' . __('You can put anything you want as a string instead and that will be used. So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso' ) . '</li>' . |
|
| 52 | + '[TKT_USES_*]' => __('This attribute based shortcode parses to show the number of uses the ticket has. The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite. Options are:', 'event_espresso'). |
|
| 53 | + '<p><ul>'. |
|
| 54 | + '<li><strong>symbol</strong>:'.__('This returns the ∞ symbol.', 'event_espresso').'</li>'. |
|
| 55 | + '<li><strong>text</strong>:'.__('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso').'</li>'. |
|
| 56 | + '<li><strong>{custom}</strong>:'.__('You can put anything you want as a string instead and that will be used. So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso').'</li>'. |
|
| 57 | 57 | '</ul></p>' |
| 58 | 58 | ); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - protected function _parser( $shortcode ) { |
|
| 62 | + protected function _parser($shortcode) { |
|
| 63 | 63 | |
| 64 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 64 | + EE_Registry::instance()->load_helper('Template'); |
|
| 65 | 65 | |
| 66 | 66 | $this->_ticket = $this->_data instanceof EE_Ticket ? $this->_data : null; |
| 67 | 67 | |
| 68 | 68 | $aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null; |
| 69 | - $aee = ! $aee instanceof EE_Messages_Addressee && is_array( $this->_extra_data ) && isset( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee; |
|
| 69 | + $aee = ! $aee instanceof EE_Messages_Addressee && is_array($this->_extra_data) && isset($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee; |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | //possible EE_Line_Item may be incoming data |
| 73 | - $this->_ticket = empty( $this->_ticket ) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty( $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] ) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket; |
|
| 73 | + $this->_ticket = empty($this->_ticket) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty($aee->line_items_with_children[$this->_data->ID()]['EE_Ticket']) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket; |
|
| 74 | 74 | |
| 75 | 75 | //if still no ticket, then let's see if there is a reg_obj. If there IS, then we'll try and grab the ticket from the reg_obj instead. |
| 76 | - if ( empty( $this->_ticket ) ) { |
|
| 76 | + if (empty($this->_ticket)) { |
|
| 77 | 77 | $this->_ticket = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->ticket() : NULL; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | //If there is no event object by now then get out. |
| 82 | - if ( ! $this->_ticket instanceof EE_Ticket ) |
|
| 82 | + if ( ! $this->_ticket instanceof EE_Ticket) |
|
| 83 | 83 | return ''; |
| 84 | 84 | |
| 85 | - switch ( $shortcode ) { |
|
| 85 | + switch ($shortcode) { |
|
| 86 | 86 | |
| 87 | 87 | case '[TICKET_ID]' : |
| 88 | 88 | return $this->_ticket->ID(); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | case '[TICKET_PRICE]' : |
| 100 | - return EEH_Template::format_currency( $this->_ticket->get('TKT_price') ); |
|
| 100 | + return EEH_Template::format_currency($this->_ticket->get('TKT_price')); |
|
| 101 | 101 | break; |
| 102 | 102 | |
| 103 | 103 | case '[TKT_QTY_PURCHASED]' : |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | break; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if ( strpos( $shortcode, '[TKT_USES_*') !== FALSE ) { |
|
| 109 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
| 110 | - $schema = empty( $attrs['schema'] ) ? null : $attrs['schema']; |
|
| 111 | - return $this->_ticket->get_pretty( 'TKT_uses', $schema ); |
|
| 108 | + if (strpos($shortcode, '[TKT_USES_*') !== FALSE) { |
|
| 109 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
| 110 | + $schema = empty($attrs['schema']) ? null : $attrs['schema']; |
|
| 111 | + return $this->_ticket->get_pretty('TKT_uses', $schema); |
|
| 112 | 112 | } |
| 113 | 113 | return ''; |
| 114 | 114 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| 65 | - protected function _parser( $shortcode ) { |
|
| 65 | + protected function _parser($shortcode) { |
|
| 66 | 66 | |
| 67 | - switch ( $shortcode ) { |
|
| 67 | + switch ($shortcode) { |
|
| 68 | 68 | |
| 69 | 69 | case '[VENUE_TITLE]' : |
| 70 | 70 | return $this->_venue('title'); |
@@ -132,38 +132,38 @@ discard block |
||
| 132 | 132 | * @param string $what What to retrieve from database |
| 133 | 133 | * @return string What was retrieved! |
| 134 | 134 | */ |
| 135 | - private function _venue( $db_ref ) { |
|
| 135 | + private function _venue($db_ref) { |
|
| 136 | 136 | |
| 137 | 137 | //we need the EE_Event object to get the venue. |
| 138 | 138 | |
| 139 | 139 | $this->_event = $this->_data instanceof EE_Event ? $this->_data : null; |
| 140 | 140 | |
| 141 | 141 | //if no event, then let's see if there is a reg_obj. If there IS, then we'll try and grab the event from the reg_obj instead. |
| 142 | - if ( empty( $this->_event ) ) { |
|
| 142 | + if (empty($this->_event)) { |
|
| 143 | 143 | $aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL; |
| 144 | 144 | $aee = $this->_extra_data instanceof EE_Messages_Addressee ? $this->_extra_data : $aee; |
| 145 | 145 | |
| 146 | 146 | $this->_event = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->event() : NULL; |
| 147 | 147 | |
| 148 | 148 | //if still empty do we have a ticket data item? |
| 149 | - $this->_event = empty( $this->_event ) && $this->_data instanceof EE_Ticket && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data']->tickets[$this->_data->ID()]['EE_Event'] : $this->_event; |
|
| 149 | + $this->_event = empty($this->_event) && $this->_data instanceof EE_Ticket && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data']->tickets[$this->_data->ID()]['EE_Event'] : $this->_event; |
|
| 150 | 150 | |
| 151 | 151 | //if STILL empty event, let's try to get the first event in the list of events via EE_Messages_Addressee and use that. |
| 152 | - $event = $aee instanceof EE_Messages_Addressee ? reset( $aee->events ) : array(); |
|
| 153 | - $this->_event = empty( $this->_event ) && !empty( $events ) ? $event : $this->_event; |
|
| 152 | + $event = $aee instanceof EE_Messages_Addressee ? reset($aee->events) : array(); |
|
| 153 | + $this->_event = empty($this->_event) && ! empty($events) ? $event : $this->_event; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | //If there is no event objecdt by now then get out. |
| 158 | - if ( ! $this->_event instanceof EE_Event ) |
|
| 158 | + if ( ! $this->_event instanceof EE_Event) |
|
| 159 | 159 | return ''; |
| 160 | 160 | |
| 161 | 161 | $venue = $this->_event->get_first_related('Venue'); |
| 162 | 162 | |
| 163 | - if ( empty( $venue ) ) |
|
| 163 | + if (empty($venue)) |
|
| 164 | 164 | return ''; //no venue so get out. |
| 165 | 165 | |
| 166 | - switch ( $db_ref ) { |
|
| 166 | + switch ($db_ref) { |
|
| 167 | 167 | case 'title': |
| 168 | 168 | return $venue->get('VNU_name'); |
| 169 | 169 | break; |
@@ -174,11 +174,11 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | case 'url': |
| 176 | 176 | $url = $venue->get('VNU_url'); |
| 177 | - return empty( $url ) ? $venue->get_permalink() : $url; |
|
| 177 | + return empty($url) ? $venue->get_permalink() : $url; |
|
| 178 | 178 | break; |
| 179 | 179 | |
| 180 | 180 | case 'image': |
| 181 | - return '<img src="' . $venue->feature_image_url(array(200,200) ) . '" alt="' . sprintf( esc_attr__( '%s Feature Image', 'event_espresso'), $venue->get('VNU_name') ) . '" />'; |
|
| 181 | + return '<img src="'.$venue->feature_image_url(array(200, 200)).'" alt="'.sprintf(esc_attr__('%s Feature Image', 'event_espresso'), $venue->get('VNU_name')).'" />'; |
|
| 182 | 182 | break; |
| 183 | 183 | |
| 184 | 184 | case 'phone': |
@@ -212,22 +212,22 @@ discard block |
||
| 212 | 212 | break; |
| 213 | 213 | |
| 214 | 214 | case 'formatted_address' : |
| 215 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
| 216 | - return EEH_Address::format( $venue ); |
|
| 215 | + EE_Registry::instance()->load_helper('Formatter'); |
|
| 216 | + return EEH_Address::format($venue); |
|
| 217 | 217 | break; |
| 218 | 218 | |
| 219 | 219 | case 'gmap_link': |
| 220 | 220 | case 'gmap_link_img': |
| 221 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
| 221 | + EE_Registry::instance()->load_helper('Maps'); |
|
| 222 | 222 | $state = $venue->state_obj(); |
| 223 | 223 | $country = $venue->country_obj(); |
| 224 | 224 | $atts = array( |
| 225 | 225 | 'id' => $venue->ID(), |
| 226 | 226 | 'address' => $venue->get('VNU_address'), |
| 227 | 227 | 'city' => $venue->get('VNU_city'), |
| 228 | - 'state' => is_object( $state ) ? $state->get('STA_name') : '', |
|
| 228 | + 'state' => is_object($state) ? $state->get('STA_name') : '', |
|
| 229 | 229 | 'zip' => $venue->get('VNU_zip'), |
| 230 | - 'country' => is_object( $country ) ? $country->get('CNT_name'): '', |
|
| 230 | + 'country' => is_object($country) ? $country->get('CNT_name') : '', |
|
| 231 | 231 | 'type' => $db_ref == 'gmap_link' ? 'url' : 'map', |
| 232 | 232 | 'map_w' => 200, |
| 233 | 233 | 'map_h' => 200 |
@@ -1,7 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** |
| 7 | 8 | * Event Espresso |
@@ -155,13 +156,16 @@ discard block |
||
| 155 | 156 | |
| 156 | 157 | |
| 157 | 158 | //If there is no event objecdt by now then get out. |
| 158 | - if ( ! $this->_event instanceof EE_Event ) |
|
| 159 | - return ''; |
|
| 159 | + if ( ! $this->_event instanceof EE_Event ) { |
|
| 160 | + return ''; |
|
| 161 | + } |
|
| 160 | 162 | |
| 161 | 163 | $venue = $this->_event->get_first_related('Venue'); |
| 162 | 164 | |
| 163 | - if ( empty( $venue ) ) |
|
| 164 | - return ''; //no venue so get out. |
|
| 165 | + if ( empty( $venue ) ) { |
|
| 166 | + return ''; |
|
| 167 | + } |
|
| 168 | + //no venue so get out. |
|
| 165 | 169 | |
| 166 | 170 | switch ( $db_ref ) { |
| 167 | 171 | case 'title': |
@@ -20,10 +20,10 @@ |
||
| 20 | 20 | <div id="ee-maintenance-mode-dv" class="" role="main"> |
| 21 | 21 | <article id="ee-maintenance-mode"> |
| 22 | 22 | <header class="event-header"> |
| 23 | - <h1 id="ee-maintenance-mode-h1"><?php _e( 'Maintenance Mode', 'event_espresso' ); ?></h1> |
|
| 23 | + <h1 id="ee-maintenance-mode-h1"><?php _e('Maintenance Mode', 'event_espresso'); ?></h1> |
|
| 24 | 24 | </header> |
| 25 | 25 | <div class="ee-maintenance-mode-dv"> |
| 26 | - <p><?php _e( 'Event Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later. ', 'event_espresso' ); ?></p> |
|
| 26 | + <p><?php _e('Event Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later. ', 'event_espresso'); ?></p> |
|
| 27 | 27 | </div> |
| 28 | 28 | </article> |
| 29 | 29 | </div> |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('ABSPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('ABSPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /* |
| 3 | 5 | Plugin Name: Event Espresso |
| 4 | 6 | Plugin URI: http://eventespresso.com/pricing/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | 42 | //Returns the plugin version |
| 43 | -if ( ! function_exists( 'espresso_version' )) { |
|
| 43 | +if ( ! function_exists('espresso_version')) { |
|
| 44 | 44 | /** |
| 45 | 45 | * espresso_version |
| 46 | 46 | * @return string |
@@ -49,92 +49,92 @@ discard block |
||
| 49 | 49 | return '4.6.23.rc.001'; |
| 50 | 50 | } |
| 51 | 51 | } else { |
| 52 | - unset( $_GET['activate'] ); |
|
| 53 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
| 52 | + unset($_GET['activate']); |
|
| 53 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 54 | 54 | } |
| 55 | 55 | // define versions |
| 56 | -define( 'EVENT_ESPRESSO_VERSION', espresso_version()); |
|
| 57 | -define( 'EE_MIN_WP_VER_REQUIRED', '4.0' ); |
|
| 58 | -define( 'EE_MIN_WP_VER_RECOMMENDED', '4.1' ); |
|
| 59 | -define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
| 60 | -define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.33' ); |
|
| 61 | -define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION ); |
|
| 62 | -define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
| 56 | +define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
| 57 | +define('EE_MIN_WP_VER_REQUIRED', '4.0'); |
|
| 58 | +define('EE_MIN_WP_VER_RECOMMENDED', '4.1'); |
|
| 59 | +define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
| 60 | +define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.33'); |
|
| 61 | +define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION); |
|
| 62 | +define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 63 | 63 | |
| 64 | 64 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
| 65 | -if ( ! defined( 'DS' )) { |
|
| 66 | - define( 'DS', '/' ); |
|
| 65 | +if ( ! defined('DS')) { |
|
| 66 | + define('DS', '/'); |
|
| 67 | 67 | } |
| 68 | -if ( ! defined( 'PS' )) { |
|
| 69 | - define( 'PS', PATH_SEPARATOR ); |
|
| 68 | +if ( ! defined('PS')) { |
|
| 69 | + define('PS', PATH_SEPARATOR); |
|
| 70 | 70 | } |
| 71 | -if( ! defined( 'SP' )){ |
|
| 72 | - define( 'SP', ' ' ); |
|
| 71 | +if ( ! defined('SP')) { |
|
| 72 | + define('SP', ' '); |
|
| 73 | 73 | } |
| 74 | -if( ! defined( 'EENL' )){ |
|
| 75 | - define( 'EENL', "\n" ); |
|
| 74 | +if ( ! defined('EENL')) { |
|
| 75 | + define('EENL', "\n"); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | -define( 'EE_SUPPORT_EMAIL', '[email protected]'); |
|
| 79 | +define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
| 80 | 80 | // define the plugin directory and URL |
| 81 | -define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE )); |
|
| 82 | -define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE )); |
|
| 83 | -define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE )); |
|
| 81 | +define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
| 82 | +define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
| 83 | +define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
| 84 | 84 | // main root folder paths |
| 85 | -define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
| 86 | -define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
| 87 | -define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
| 88 | -define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
| 89 | -define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
| 90 | -define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
| 91 | -define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS); |
|
| 92 | -define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
| 85 | +define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
| 86 | +define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
| 87 | +define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
| 88 | +define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
| 89 | +define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
| 90 | +define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
| 91 | +define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
| 92 | +define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
| 93 | 93 | // core system paths |
| 94 | -define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
| 95 | -define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
| 96 | -define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
| 97 | -define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
| 98 | -define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
| 99 | -define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
| 100 | -define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
| 101 | -define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
| 102 | -define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
| 103 | -define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
| 104 | -define( 'EE_FORM_SECTIONS', EE_LIBRARIES .'form_sections' . DS ); |
|
| 94 | +define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
| 95 | +define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
| 96 | +define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
| 97 | +define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
| 98 | +define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
| 99 | +define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
| 100 | +define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
| 101 | +define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
| 102 | +define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
| 103 | +define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
| 104 | +define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
| 105 | 105 | // gateways |
| 106 | -define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
| 107 | -define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
| 106 | +define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
| 107 | +define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
| 108 | 108 | // asset URL paths |
| 109 | -define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
| 110 | -define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
| 111 | -define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
| 112 | -define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
| 113 | -define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
| 114 | -define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/'); |
|
| 109 | +define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
| 110 | +define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
| 111 | +define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
| 112 | +define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
| 113 | +define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
| 114 | +define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
| 115 | 115 | |
| 116 | 116 | // define upload paths |
| 117 | 117 | $uploads = wp_upload_dir(); |
| 118 | 118 | // define the uploads directory and URL |
| 119 | -define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS ); |
|
| 120 | -define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS ); |
|
| 119 | +define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
| 120 | +define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
| 121 | 121 | // define the templates directory and URL |
| 122 | -define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS ); |
|
| 123 | -define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS ); |
|
| 122 | +define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
| 123 | +define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
| 124 | 124 | // define the gateway directory and URL |
| 125 | -define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
| 126 | -define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
| 125 | +define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
| 126 | +define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
| 127 | 127 | // languages folder/path |
| 128 | -define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
| 129 | -define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
| 128 | +define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
| 129 | +define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
| 130 | 130 | //check for dompdf fonts in uploads |
| 131 | -if( file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ){ |
|
| 132 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
| 131 | +if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
| 132 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | //ajax constants |
| 136 | -define( 'EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset( $_REQUEST['data']['ee_front_ajax'] ) ? TRUE : FALSE ); |
|
| 137 | -define( 'EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset( $_REQUEST['data']['ee_admin_ajax'] ) ? TRUE : FALSE ); |
|
| 136 | +define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? TRUE : FALSE); |
|
| 137 | +define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? TRUE : FALSE); |
|
| 138 | 138 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
| 139 | 139 | //you're better to use this than its straight value (currently -1) in case you ever |
| 140 | 140 | //want to change its default value! or find when -1 means infinity |
@@ -149,10 +149,10 @@ discard block |
||
| 149 | 149 | function espresso_duplicate_plugin_error() { |
| 150 | 150 | ?> |
| 151 | 151 | <div class="error"> |
| 152 | - <p><?php _e( 'Can not run multiple versions of Event Espresso! Please deactivate one of the versions.', 'event_espresso' ); ?></p> |
|
| 152 | + <p><?php _e('Can not run multiple versions of Event Espresso! Please deactivate one of the versions.', 'event_espresso'); ?></p> |
|
| 153 | 153 | </div> |
| 154 | 154 | <?php |
| 155 | - EE_System::deactivate_plugin( EE_PLUGIN_BASENAME ); |
|
| 155 | + EE_System::deactivate_plugin(EE_PLUGIN_BASENAME); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
| 163 | 163 | */ |
| 164 | 164 | function espresso_plugin_activation() { |
| 165 | - update_option( 'ee_espresso_activation', TRUE ); |
|
| 165 | + update_option('ee_espresso_activation', TRUE); |
|
| 166 | 166 | } |
| 167 | -register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
| 167 | +register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 168 | 168 | |
| 169 | 169 | |
| 170 | 170 | |
@@ -172,10 +172,10 @@ discard block |
||
| 172 | 172 | * espresso_plugin_deactivation |
| 173 | 173 | */ |
| 174 | 174 | function espresso_plugin_deactivation() { |
| 175 | - espresso_load_required( 'EEH_Activation', EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
| 175 | + espresso_load_required('EEH_Activation', EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 176 | 176 | EEH_Activation::plugin_deactivation(); |
| 177 | 177 | } |
| 178 | -register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' ); |
|
| 178 | +register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
| 179 | 179 | |
| 180 | 180 | |
| 181 | 181 | |
@@ -185,15 +185,15 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | function espresso_load_error_handling() { |
| 187 | 187 | // load debugging tools |
| 188 | - if ( WP_DEBUG === TRUE ) { |
|
| 189 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
| 188 | + if (WP_DEBUG === TRUE) { |
|
| 189 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
| 190 | 190 | EEH_Debug_Tools::instance(); |
| 191 | 191 | } |
| 192 | 192 | // load error handling |
| 193 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' )) { |
|
| 194 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
| 193 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
| 194 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
| 195 | 195 | } else { |
| 196 | - wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' )); |
|
| 196 | + wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
@@ -203,13 +203,13 @@ discard block |
||
| 203 | 203 | * espresso_load_required |
| 204 | 204 | * given a class name and path, this function will load that file or throw an exception |
| 205 | 205 | */ |
| 206 | -function espresso_load_required( $classname, $full_path_to_file ) { |
|
| 206 | +function espresso_load_required($classname, $full_path_to_file) { |
|
| 207 | 207 | espresso_load_error_handling(); |
| 208 | - if ( is_readable( $full_path_to_file )) { |
|
| 209 | - require_once( $full_path_to_file ); |
|
| 208 | + if (is_readable($full_path_to_file)) { |
|
| 209 | + require_once($full_path_to_file); |
|
| 210 | 210 | } else { |
| 211 | - throw new EE_Error ( sprintf ( |
|
| 212 | - __( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ), |
|
| 211 | + throw new EE_Error(sprintf( |
|
| 212 | + __('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'), |
|
| 213 | 213 | $classname |
| 214 | 214 | )); |
| 215 | 215 | } |
@@ -217,5 +217,5 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | |
| 219 | 219 | |
| 220 | -espresso_load_required( 'EE_System', EE_CORE . 'EE_System.core.php' ); |
|
| 220 | +espresso_load_required('EE_System', EE_CORE.'EE_System.core.php'); |
|
| 221 | 221 | EE_System::instance(); |
@@ -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 | * |
| 4 | 6 | * EED_Add_New_State class |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @return EED_Add_New_State |
| 17 | 17 | */ |
| 18 | 18 | public static function instance() { |
| 19 | - return parent::get_instance( __CLASS__ ); |
|
| 19 | + return parent::get_instance(__CLASS__); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | 29 | public static function set_hooks() { |
| 30 | - add_action( 'wp_loaded', array( 'EED_Add_New_State', 'set_definitions' ), 2 ); |
|
| 31 | - add_action( 'wp_enqueue_scripts', array( 'EED_Add_New_State', 'translate_js_strings' ), 1 ); |
|
| 32 | - add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 ); |
|
| 33 | - add_filter( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 ); |
|
| 34 | - add_filter( 'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array( 'EED_Add_New_State', 'unset_new_state_request_params' ), 10, 1 ); |
|
| 35 | - add_filter( 'FHEE__EE_State_Select_Input____construct__state_options', array( 'EED_Add_New_State', 'state_options' ), 10, 1 ); |
|
| 36 | - add_filter( 'FHEE__EE_Country_Select_Input____construct__country_options', array( 'EED_Add_New_State', 'country_options' ), 10, 1 ); |
|
| 30 | + add_action('wp_loaded', array('EED_Add_New_State', 'set_definitions'), 2); |
|
| 31 | + add_action('wp_enqueue_scripts', array('EED_Add_New_State', 'translate_js_strings'), 1); |
|
| 32 | + add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1); |
|
| 33 | + add_filter('FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1); |
|
| 34 | + add_filter('FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array('EED_Add_New_State', 'unset_new_state_request_params'), 10, 1); |
|
| 35 | + add_filter('FHEE__EE_State_Select_Input____construct__state_options', array('EED_Add_New_State', 'state_options'), 10, 1); |
|
| 36 | + add_filter('FHEE__EE_Country_Select_Input____construct__country_options', array('EED_Add_New_State', 'country_options'), 10, 1); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -43,17 +43,17 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | 45 | public static function set_hooks_admin() { |
| 46 | - add_action( 'wp_loaded', array( 'EED_Add_New_State', 'set_definitions' ), 2 ); |
|
| 47 | - add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 ); |
|
| 48 | - add_filter( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 ); |
|
| 49 | - add_action( 'wp_ajax_espresso_add_new_state', array( 'EED_Add_New_State', 'add_new_state' )); |
|
| 50 | - add_action( 'wp_ajax_nopriv_espresso_add_new_state', array( 'EED_Add_New_State', 'add_new_state' )); |
|
| 51 | - add_filter( 'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array( 'EED_Add_New_State', 'unset_new_state_request_params' ), 10, 1 ); |
|
| 52 | - add_action( 'AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', array( 'EED_Add_New_State', 'update_country_settings' ), 10, 3 ); |
|
| 53 | - add_action( 'AHEE__General_Settings_Admin_Page__delete_state__state_deleted', array( 'EED_Add_New_State', 'update_country_settings' ), 10, 3 ); |
|
| 54 | - add_filter( 'FHEE__EE_State_Select_Input____construct__state_options', array( 'EED_Add_New_State', 'state_options' ), 10, 1 ); |
|
| 55 | - add_filter( 'FHEE__EE_Country_Select_Input____construct__country_options', array( 'EED_Add_New_State', 'country_options' ), 10, 1 ); |
|
| 56 | - add_filter( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', array( 'EED_Add_New_State', 'filter_checkout_request_params' ), 10, 1 ); |
|
| 46 | + add_action('wp_loaded', array('EED_Add_New_State', 'set_definitions'), 2); |
|
| 47 | + add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1); |
|
| 48 | + add_filter('FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1); |
|
| 49 | + add_action('wp_ajax_espresso_add_new_state', array('EED_Add_New_State', 'add_new_state')); |
|
| 50 | + add_action('wp_ajax_nopriv_espresso_add_new_state', array('EED_Add_New_State', 'add_new_state')); |
|
| 51 | + add_filter('FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array('EED_Add_New_State', 'unset_new_state_request_params'), 10, 1); |
|
| 52 | + add_action('AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', array('EED_Add_New_State', 'update_country_settings'), 10, 3); |
|
| 53 | + add_action('AHEE__General_Settings_Admin_Page__delete_state__state_deleted', array('EED_Add_New_State', 'update_country_settings'), 10, 3); |
|
| 54 | + add_filter('FHEE__EE_State_Select_Input____construct__state_options', array('EED_Add_New_State', 'state_options'), 10, 1); |
|
| 55 | + add_filter('FHEE__EE_Country_Select_Input____construct__country_options', array('EED_Add_New_State', 'country_options'), 10, 1); |
|
| 56 | + add_filter('FHEE__Single_Page_Checkout___check_form_submission__request_params', array('EED_Add_New_State', 'filter_checkout_request_params'), 10, 1); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | * @return void |
| 66 | 66 | */ |
| 67 | 67 | public static function set_definitions() { |
| 68 | - define( 'ANS_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 69 | - define( 'ANS_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
| 68 | + define('ANS_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 69 | + define('ANS_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @param \WP $WP |
| 79 | 79 | * @return void |
| 80 | 80 | */ |
| 81 | - public function run( $WP ) { |
|
| 81 | + public function run($WP) { |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | * @return void |
| 107 | 107 | */ |
| 108 | 108 | public static function wp_enqueue_scripts() { |
| 109 | - wp_register_script( 'add_new_state', ANS_ASSETS_URL . 'add_new_state.js', array( 'espresso_core', 'single_page_checkout' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
| 110 | - wp_enqueue_script( 'add_new_state' ); |
|
| 109 | + wp_register_script('add_new_state', ANS_ASSETS_URL.'add_new_state.js', array('espresso_core', 'single_page_checkout'), EVENT_ESPRESSO_VERSION, TRUE); |
|
| 110 | + wp_enqueue_script('add_new_state'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
@@ -120,31 +120,31 @@ discard block |
||
| 120 | 120 | * @return string |
| 121 | 121 | */ |
| 122 | 122 | // public static function display_add_new_state_micro_form( $html, EE_Form_Input_With_Options_Base $input ){ |
| 123 | - public static function display_add_new_state_micro_form( EE_Form_Section_Proper $question_group_reg_form ){ |
|
| 123 | + public static function display_add_new_state_micro_form(EE_Form_Section_Proper $question_group_reg_form) { |
|
| 124 | 124 | // only add the 'new_state_micro_form' when displaying reg forms, |
| 125 | 125 | // not during processing since we process the 'new_state_micro_form' in it's own AJAX request |
| 126 | - if ( EE_Registry::instance()->REQ->get( 'action', '' ) === 'process_reg_step' ) { |
|
| 126 | + if (EE_Registry::instance()->REQ->get('action', '') === 'process_reg_step') { |
|
| 127 | 127 | return $question_group_reg_form; |
| 128 | 128 | } |
| 129 | 129 | // is the "state" question in this form section? |
| 130 | - $input = $question_group_reg_form->get_subsection( 'state' ); |
|
| 130 | + $input = $question_group_reg_form->get_subsection('state'); |
|
| 131 | 131 | // we're only doing this for state select inputs |
| 132 | - if ( $input instanceof EE_State_Select_Input ) { |
|
| 132 | + if ($input instanceof EE_State_Select_Input) { |
|
| 133 | 133 | // load helpers |
| 134 | - EE_Registry::instance()->load_helper( 'HTML' ); |
|
| 134 | + EE_Registry::instance()->load_helper('HTML'); |
|
| 135 | 135 | // load JS |
| 136 | - add_action( 'wp_enqueue_scripts', array( 'EED_Add_New_State', 'wp_enqueue_scripts' ), 10 ); |
|
| 136 | + add_action('wp_enqueue_scripts', array('EED_Add_New_State', 'wp_enqueue_scripts'), 10); |
|
| 137 | 137 | // grab any set values from the request |
| 138 | - $country_name = str_replace( 'state', 'new_state_country', $input->html_name() ); |
|
| 139 | - $state_name = str_replace( 'state', 'new_state_name', $input->html_name() ); |
|
| 140 | - $abbrv_name = str_replace( 'state', 'new_state_abbrv', $input->html_name() ); |
|
| 141 | - $new_state_submit_id = str_replace( 'state', 'new_state', $input->html_id() ); |
|
| 138 | + $country_name = str_replace('state', 'new_state_country', $input->html_name()); |
|
| 139 | + $state_name = str_replace('state', 'new_state_name', $input->html_name()); |
|
| 140 | + $abbrv_name = str_replace('state', 'new_state_abbrv', $input->html_name()); |
|
| 141 | + $new_state_submit_id = str_replace('state', 'new_state', $input->html_id()); |
|
| 142 | 142 | $country_options = array(); |
| 143 | 143 | $countries = EEM_Country::instance()->get_all_countries(); |
| 144 | - if ( ! empty( $countries )) { |
|
| 145 | - foreach( $countries as $country ){ |
|
| 146 | - if ( $country instanceof EE_Country ) { |
|
| 147 | - $country_options[ $country->ID() ] = $country->name(); |
|
| 144 | + if ( ! empty($countries)) { |
|
| 145 | + foreach ($countries as $country) { |
|
| 146 | + if ($country instanceof EE_Country) { |
|
| 147 | + $country_options[$country->ID()] = $country->name(); |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | // add hidden input to indicate that a new state is being added |
| 158 | 158 | 'add_new_state' => new EE_Hidden_Input( |
| 159 | 159 | array( |
| 160 | - 'html_name' => str_replace( 'state', 'add_new_state', $input->html_name() ), |
|
| 161 | - 'html_id' => str_replace( 'state', 'add_new_state', $input->html_id() ), |
|
| 160 | + 'html_name' => str_replace('state', 'add_new_state', $input->html_name()), |
|
| 161 | + 'html_id' => str_replace('state', 'add_new_state', $input->html_id()), |
|
| 162 | 162 | 'default' => 0 |
| 163 | 163 | ) |
| 164 | 164 | ), |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | '', |
| 171 | 171 | __('click here to add a new state/province', 'event_espresso'), |
| 172 | 172 | '', |
| 173 | - 'display-' . $input->html_id(), |
|
| 173 | + 'display-'.$input->html_id(), |
|
| 174 | 174 | 'ee-form-add-new-state-lnk display-the-hidden smaller-text hide-if-no-js', |
| 175 | 175 | '', |
| 176 | - 'rel="' . $input->html_id() . '"' |
|
| 176 | + 'rel="'.$input->html_id().'"' |
|
| 177 | 177 | ) |
| 178 | 178 | ) |
| 179 | 179 | ), |
@@ -181,13 +181,13 @@ discard block |
||
| 181 | 181 | 'add_new_state_micro_form' =>new EE_Form_Section_HTML( |
| 182 | 182 | apply_filters( |
| 183 | 183 | 'FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_micro_form', |
| 184 | - EEH_HTML::div( '', $input->html_id() . '-dv', 'ee-form-add-new-state-dv', 'display: none;' ) . |
|
| 185 | - EEH_HTML::h6( __('If your State/Province does not appear in the list above, you can easily add it by doing the following:', 'event_espresso')) . |
|
| 186 | - EEH_HTML::ul() . |
|
| 187 | - EEH_HTML::li( __('first select the Country that your State/Province belongs to', 'event_espresso') ) . |
|
| 188 | - EEH_HTML::li( __('enter the name of your State/Province', 'event_espresso') ) . |
|
| 189 | - EEH_HTML::li( __('enter a two to six letter abbreviation for the name of your State/Province', 'event_espresso') ) . |
|
| 190 | - EEH_HTML::li( __('click the ADD button', 'event_espresso') ) . |
|
| 184 | + EEH_HTML::div('', $input->html_id().'-dv', 'ee-form-add-new-state-dv', 'display: none;'). |
|
| 185 | + EEH_HTML::h6(__('If your State/Province does not appear in the list above, you can easily add it by doing the following:', 'event_espresso')). |
|
| 186 | + EEH_HTML::ul(). |
|
| 187 | + EEH_HTML::li(__('first select the Country that your State/Province belongs to', 'event_espresso')). |
|
| 188 | + EEH_HTML::li(__('enter the name of your State/Province', 'event_espresso')). |
|
| 189 | + EEH_HTML::li(__('enter a two to six letter abbreviation for the name of your State/Province', 'event_espresso')). |
|
| 190 | + EEH_HTML::li(__('click the ADD button', 'event_espresso')). |
|
| 191 | 191 | EEH_HTML::ulx() |
| 192 | 192 | ) |
| 193 | 193 | ), |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | $country_options, |
| 197 | 197 | array( |
| 198 | 198 | 'html_name' => $country_name, |
| 199 | - 'html_id' => str_replace( 'state', 'new_state_country', $input->html_id() ), |
|
| 200 | - 'html_class' => $input->html_class() . ' new-state-country', |
|
| 199 | + 'html_id' => str_replace('state', 'new_state_country', $input->html_id()), |
|
| 200 | + 'html_class' => $input->html_class().' new-state-country', |
|
| 201 | 201 | 'html_label_text' => __('New State/Province Country', 'event_espresso'), |
| 202 | - 'default' => EE_Registry::instance()->REQ->get( $country_name, '' ), |
|
| 202 | + 'default' => EE_Registry::instance()->REQ->get($country_name, ''), |
|
| 203 | 203 | 'required' => false |
| 204 | 204 | ) |
| 205 | 205 | ), |
@@ -207,23 +207,23 @@ discard block |
||
| 207 | 207 | 'new_state_name' => new EE_Text_Input( |
| 208 | 208 | array( |
| 209 | 209 | 'html_name' => $state_name, |
| 210 | - 'html_id' => str_replace( 'state', 'new_state_name', $input->html_id() ), |
|
| 211 | - 'html_class' => $input->html_class() . ' new-state-state', |
|
| 210 | + 'html_id' => str_replace('state', 'new_state_name', $input->html_id()), |
|
| 211 | + 'html_class' => $input->html_class().' new-state-state', |
|
| 212 | 212 | 'html_label_text' => __('New State/Province Name', 'event_espresso'), |
| 213 | - 'default' => EE_Registry::instance()->REQ->get( $state_name, '' ), |
|
| 213 | + 'default' => EE_Registry::instance()->REQ->get($state_name, ''), |
|
| 214 | 214 | 'required' => false |
| 215 | 215 | ) |
| 216 | 216 | ), |
| 217 | - 'spacer' => new EE_Form_Section_HTML( EEH_HTML::br() ), |
|
| 217 | + 'spacer' => new EE_Form_Section_HTML(EEH_HTML::br()), |
|
| 218 | 218 | // NEW STATE NAME |
| 219 | 219 | 'new_state_abbrv' => new EE_Text_Input( |
| 220 | 220 | array( |
| 221 | 221 | 'html_name' => $abbrv_name, |
| 222 | - 'html_id' => str_replace( 'state', 'new_state_abbrv', $input->html_id() ), |
|
| 223 | - 'html_class' => $input->html_class() . ' new-state-abbrv', |
|
| 222 | + 'html_id' => str_replace('state', 'new_state_abbrv', $input->html_id()), |
|
| 223 | + 'html_class' => $input->html_class().' new-state-abbrv', |
|
| 224 | 224 | 'html_label_text' => __('New State/Province Abbreviation', 'event_espresso'), |
| 225 | 225 | 'html_other_attributes' => 'size="24"', |
| 226 | - 'default' => EE_Registry::instance()->REQ->get( $abbrv_name, '' ), |
|
| 226 | + 'default' => EE_Registry::instance()->REQ->get($abbrv_name, ''), |
|
| 227 | 227 | 'required' => false |
| 228 | 228 | ) |
| 229 | 229 | ), |
@@ -231,26 +231,26 @@ discard block |
||
| 231 | 231 | 'add_new_state_submit_button' => new EE_Form_Section_HTML( |
| 232 | 232 | apply_filters( |
| 233 | 233 | 'FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_submit_button', |
| 234 | - EEH_HTML::nbsp(3) . |
|
| 235 | - EEH_HTML::link( '', __('ADD', 'event_espresso'), '', 'submit-' . $new_state_submit_id, 'ee-form-add-new-state-submit button button-secondary', '', 'rel="' . $new_state_submit_id . '"' ) |
|
| 234 | + EEH_HTML::nbsp(3). |
|
| 235 | + EEH_HTML::link('', __('ADD', 'event_espresso'), '', 'submit-'.$new_state_submit_id, 'ee-form-add-new-state-submit button button-secondary', '', 'rel="'.$new_state_submit_id.'"') |
|
| 236 | 236 | ) |
| 237 | 237 | ), |
| 238 | 238 | // extra info |
| 239 | 239 | 'add_new_state_extra' => new EE_Form_Section_HTML( |
| 240 | 240 | apply_filters( |
| 241 | 241 | 'FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_extra', |
| 242 | - EEH_HTML::br(2) . |
|
| 243 | - EEH_HTML::div( '', '', 'small-text' ) . |
|
| 244 | - EEH_HTML::strong( __('Don\'t know your State/Province Abbreviation?', 'event_espresso') ) . |
|
| 245 | - EEH_HTML::br() . |
|
| 242 | + EEH_HTML::br(2). |
|
| 243 | + EEH_HTML::div('', '', 'small-text'). |
|
| 244 | + EEH_HTML::strong(__('Don\'t know your State/Province Abbreviation?', 'event_espresso')). |
|
| 245 | + EEH_HTML::br(). |
|
| 246 | 246 | sprintf( |
| 247 | 247 | __('You can look here: %s, for a list of Countries and links to their State/Province Abbreviations ("Subdivisions assigned codes" column).', 'event_espresso'), |
| 248 | - EEH_HTML::link( 'http://en.wikipedia.org/wiki/ISO_3166-2', 'http://en.wikipedia.org/wiki/ISO_3166-2', '', '', 'ee-form-add-new-state-wiki-lnk' ) |
|
| 249 | - ) . |
|
| 250 | - EEH_HTML::divx() . |
|
| 251 | - EEH_HTML::br() . |
|
| 252 | - EEH_HTML::link( '', __('cancel new state/province', 'event_espresso'), '', 'hide-' . $input->html_id(), 'ee-form-cancel-new-state-lnk smaller-text', '', 'rel="' . $input->html_id() . '"' ) . |
|
| 253 | - EEH_HTML::divx() . |
|
| 248 | + EEH_HTML::link('http://en.wikipedia.org/wiki/ISO_3166-2', 'http://en.wikipedia.org/wiki/ISO_3166-2', '', '', 'ee-form-add-new-state-wiki-lnk') |
|
| 249 | + ). |
|
| 250 | + EEH_HTML::divx(). |
|
| 251 | + EEH_HTML::br(). |
|
| 252 | + EEH_HTML::link('', __('cancel new state/province', 'event_espresso'), '', 'hide-'.$input->html_id(), 'ee-form-cancel-new-state-lnk smaller-text', '', 'rel="'.$input->html_id().'"'). |
|
| 253 | + EEH_HTML::divx(). |
|
| 254 | 254 | EEH_HTML::br(2) |
| 255 | 255 | ) |
| 256 | 256 | ) |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | ) |
| 259 | 259 | ) |
| 260 | 260 | ); |
| 261 | - $question_group_reg_form->add_subsections( array( 'new_state_micro_form' => $new_state_micro_form ), 'country' ); |
|
| 261 | + $question_group_reg_form->add_subsections(array('new_state_micro_form' => $new_state_micro_form), 'country'); |
|
| 262 | 262 | } |
| 263 | 263 | return $question_group_reg_form; |
| 264 | 264 | } |
@@ -275,41 +275,41 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | public static function add_new_state() { |
| 277 | 277 | $REQ = EE_Registry::instance()->load_core('Request_Handler'); |
| 278 | - if ( $REQ->is_set( 'add_new_state' ) && $REQ->get( 'add_new_state' ) == 1 ) { |
|
| 278 | + if ($REQ->is_set('add_new_state') && $REQ->get('add_new_state') == 1) { |
|
| 279 | 279 | EE_Registry::instance()->load_model('State'); |
| 280 | 280 | // grab country ISO code, new state name, and new state abbreviation |
| 281 | - $state_country = $REQ->is_set( 'new_state_country' ) ? sanitize_text_field( $REQ->get( 'new_state_country' )) : FALSE; |
|
| 282 | - $state_name = $REQ->is_set( 'new_state_name' ) ? sanitize_text_field( $REQ->get( 'new_state_name' )) : FALSE; |
|
| 283 | - $state_abbr = $REQ->is_set( 'new_state_abbrv' ) ? sanitize_text_field( $REQ->get( 'new_state_abbrv' )) : FALSE; |
|
| 281 | + $state_country = $REQ->is_set('new_state_country') ? sanitize_text_field($REQ->get('new_state_country')) : FALSE; |
|
| 282 | + $state_name = $REQ->is_set('new_state_name') ? sanitize_text_field($REQ->get('new_state_name')) : FALSE; |
|
| 283 | + $state_abbr = $REQ->is_set('new_state_abbrv') ? sanitize_text_field($REQ->get('new_state_abbrv')) : FALSE; |
|
| 284 | 284 | |
| 285 | 285 | //echo '<h4>$state_country : ' . $state_country . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
| 286 | 286 | //echo '<h4>$state_name : ' . $state_name . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
| 287 | 287 | //echo '<h4>$state_abbr : ' . $state_abbr . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
| 288 | 288 | |
| 289 | - if ( $state_country && $state_name && $state_abbr ) { |
|
| 290 | - $new_state = EED_Add_New_State::save_new_state_to_db( array( |
|
| 291 | - 'CNT_ISO'=> strtoupper( $state_country ), |
|
| 292 | - 'STA_abbrev' => strtoupper( $state_abbr ), |
|
| 293 | - 'STA_name' => ucwords( $state_name ), |
|
| 289 | + if ($state_country && $state_name && $state_abbr) { |
|
| 290 | + $new_state = EED_Add_New_State::save_new_state_to_db(array( |
|
| 291 | + 'CNT_ISO'=> strtoupper($state_country), |
|
| 292 | + 'STA_abbrev' => strtoupper($state_abbr), |
|
| 293 | + 'STA_name' => ucwords($state_name), |
|
| 294 | 294 | 'STA_active' => FALSE |
| 295 | 295 | )); |
| 296 | 296 | |
| 297 | - if ( $new_state instanceof EE_State ) { |
|
| 297 | + if ($new_state instanceof EE_State) { |
|
| 298 | 298 | // clean house |
| 299 | - EE_Registry::instance()->REQ->un_set( 'add_new_state' ); |
|
| 300 | - EE_Registry::instance()->REQ->un_set( 'new_state_country' ); |
|
| 301 | - EE_Registry::instance()->REQ->un_set( 'new_state_name' ); |
|
| 302 | - EE_Registry::instance()->REQ->un_set( 'new_state_abbrv' ); |
|
| 299 | + EE_Registry::instance()->REQ->un_set('add_new_state'); |
|
| 300 | + EE_Registry::instance()->REQ->un_set('new_state_country'); |
|
| 301 | + EE_Registry::instance()->REQ->un_set('new_state_name'); |
|
| 302 | + EE_Registry::instance()->REQ->un_set('new_state_abbrv'); |
|
| 303 | 303 | |
| 304 | 304 | // get any existing new states |
| 305 | 305 | $new_states = EE_Registry::instance()->SSN->get_session_data( |
| 306 | 306 | 'new_states' |
| 307 | 307 | ); |
| 308 | - $new_states[ $new_state->ID() ] = $new_state; |
|
| 309 | - EE_Registry::instance()->SSN->set_session_data( array( 'new_states' => $new_states )); |
|
| 308 | + $new_states[$new_state->ID()] = $new_state; |
|
| 309 | + EE_Registry::instance()->SSN->set_session_data(array('new_states' => $new_states)); |
|
| 310 | 310 | |
| 311 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
| 312 | - echo json_encode( array( |
|
| 311 | + if (EE_Registry::instance()->REQ->ajax) { |
|
| 312 | + echo json_encode(array( |
|
| 313 | 313 | 'success' => TRUE, |
| 314 | 314 | 'id' => $new_state->ID(), |
| 315 | 315 | 'name' => $new_state->name(), |
@@ -324,12 +324,12 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | } else { |
| 327 | - $error = __( 'A new State/Province could not be added because invalid or missing data was received.', 'event_espresso' ); |
|
| 328 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
| 329 | - echo json_encode( array( 'error' => $error )); |
|
| 327 | + $error = __('A new State/Province could not be added because invalid or missing data was received.', 'event_espresso'); |
|
| 328 | + if (EE_Registry::instance()->REQ->ajax) { |
|
| 329 | + echo json_encode(array('error' => $error)); |
|
| 330 | 330 | exit(); |
| 331 | 331 | } else { |
| 332 | - EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 332 | + EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__); |
|
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | } |
@@ -347,11 +347,11 @@ discard block |
||
| 347 | 347 | * @param array $request_params |
| 348 | 348 | * @return void |
| 349 | 349 | */ |
| 350 | - public static function filter_checkout_request_params ( $request_params ) { |
|
| 351 | - foreach ( $request_params as $form_section ) { |
|
| 352 | - if ( is_array( $form_section )) { |
|
| 353 | - EED_Add_New_State::unset_new_state_request_params( $form_section ); |
|
| 354 | - EED_Add_New_State::filter_checkout_request_params( $form_section ); |
|
| 350 | + public static function filter_checkout_request_params($request_params) { |
|
| 351 | + foreach ($request_params as $form_section) { |
|
| 352 | + if (is_array($form_section)) { |
|
| 353 | + EED_Add_New_State::unset_new_state_request_params($form_section); |
|
| 354 | + EED_Add_New_State::filter_checkout_request_params($form_section); |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | } |
@@ -365,12 +365,12 @@ discard block |
||
| 365 | 365 | * @param array $request_params |
| 366 | 366 | * @return boolean |
| 367 | 367 | */ |
| 368 | - public static function unset_new_state_request_params ( $request_params ) { |
|
| 369 | - unset( $request_params['new_state_micro_form'] ); |
|
| 370 | - unset( $request_params['add_new_state'] ); |
|
| 371 | - unset( $request_params['new_state_country'] ); |
|
| 372 | - unset( $request_params['new_state_name'] ); |
|
| 373 | - unset( $request_params['new_state_abbrv'] ); |
|
| 368 | + public static function unset_new_state_request_params($request_params) { |
|
| 369 | + unset($request_params['new_state_micro_form']); |
|
| 370 | + unset($request_params['add_new_state']); |
|
| 371 | + unset($request_params['new_state_country']); |
|
| 372 | + unset($request_params['new_state_name']); |
|
| 373 | + unset($request_params['new_state_abbrv']); |
|
| 374 | 374 | return $request_params; |
| 375 | 375 | } |
| 376 | 376 | |
@@ -383,26 +383,26 @@ discard block |
||
| 383 | 383 | * @param array $props_n_values |
| 384 | 384 | * @return boolean |
| 385 | 385 | */ |
| 386 | - public static function save_new_state_to_db ( $props_n_values = array() ) { |
|
| 386 | + public static function save_new_state_to_db($props_n_values = array()) { |
|
| 387 | 387 | // EEH_Debug_Tools::printr( $props_n_values, '$props_n_values <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 388 | - $existing_state = EEM_State::instance()->get_all( array( $props_n_values, 'limit' => 1 )); |
|
| 389 | - if ( ! empty( $existing_state )) { |
|
| 390 | - return array_pop( $existing_state ); |
|
| 388 | + $existing_state = EEM_State::instance()->get_all(array($props_n_values, 'limit' => 1)); |
|
| 389 | + if ( ! empty($existing_state)) { |
|
| 390 | + return array_pop($existing_state); |
|
| 391 | 391 | } |
| 392 | - $new_state = EE_State::new_instance( $props_n_values ); |
|
| 393 | - if ( $new_state instanceof EE_State ) { |
|
| 392 | + $new_state = EE_State::new_instance($props_n_values); |
|
| 393 | + if ($new_state instanceof EE_State) { |
|
| 394 | 394 | // if not non-ajax admin |
| 395 | - $new_state_key = $new_state->country_iso() . '-' . $new_state->abbrev(); |
|
| 395 | + $new_state_key = $new_state->country_iso().'-'.$new_state->abbrev(); |
|
| 396 | 396 | $new_state_notice = sprintf( |
| 397 | - __( 'A new State named "%1$s (%2$s)" was dynamically added from an Event Espresso form for the Country of "%3$s".%5$sTo verify, edit, and/or delete this new State, please go to the %4$s and update the States / Provinces section.%5$sCheck "Yes" to have this new State |
|
| 398 | - added to dropdown select lists in forms.', 'event_espresso' ), |
|
| 399 | - '<b>' . $new_state->name() . '</b>', |
|
| 400 | - '<b>' . $new_state->abbrev() . '</b>', |
|
| 401 | - '<b>' . $new_state->country()->name() . '</b>', |
|
| 402 | - '<a href="' . add_query_arg( array( 'page' => 'espresso_general_settings', 'action' => 'country_settings', 'country' => $new_state->country_iso() ), admin_url( 'admin.php' )) . '">' . __( 'Event Espresso - General Settings > Countries Tab', 'event_espresso' ) . '</a>', |
|
| 397 | + __('A new State named "%1$s (%2$s)" was dynamically added from an Event Espresso form for the Country of "%3$s".%5$sTo verify, edit, and/or delete this new State, please go to the %4$s and update the States / Provinces section.%5$sCheck "Yes" to have this new State |
|
| 398 | + added to dropdown select lists in forms.', 'event_espresso'), |
|
| 399 | + '<b>'.$new_state->name().'</b>', |
|
| 400 | + '<b>'.$new_state->abbrev().'</b>', |
|
| 401 | + '<b>'.$new_state->country()->name().'</b>', |
|
| 402 | + '<a href="'.add_query_arg(array('page' => 'espresso_general_settings', 'action' => 'country_settings', 'country' => $new_state->country_iso()), admin_url('admin.php')).'">'.__('Event Espresso - General Settings > Countries Tab', 'event_espresso').'</a>', |
|
| 403 | 403 | '<br />' |
| 404 | 404 | ); |
| 405 | - EE_Error::add_persistent_admin_notice( $new_state_key, $new_state_notice ); |
|
| 405 | + EE_Error::add_persistent_admin_notice($new_state_key, $new_state_notice); |
|
| 406 | 406 | $new_state->save(); |
| 407 | 407 | EEM_State::instance()->reset_cached_states(); |
| 408 | 408 | return $new_state; |
@@ -421,22 +421,22 @@ discard block |
||
| 421 | 421 | * @param array $cols_n_values |
| 422 | 422 | * @return boolean |
| 423 | 423 | */ |
| 424 | - public static function update_country_settings( $CNT_ISO = '', $STA_ID = '', $cols_n_values = array() ) { |
|
| 425 | - $CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : FALSE; |
|
| 426 | - if ( ! $CNT_ISO ) { |
|
| 427 | - EE_Error::add_error( __( 'An invalid or missing Country ISO Code was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 424 | + public static function update_country_settings($CNT_ISO = '', $STA_ID = '', $cols_n_values = array()) { |
|
| 425 | + $CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : FALSE; |
|
| 426 | + if ( ! $CNT_ISO) { |
|
| 427 | + EE_Error::add_error(__('An invalid or missing Country ISO Code was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 428 | 428 | } |
| 429 | - $STA_abbrev = is_array( $cols_n_values ) && isset( $cols_n_values['STA_abbrev'] ) ? $cols_n_values['STA_abbrev'] : FALSE; |
|
| 430 | - if ( ! $STA_abbrev && ! empty( $STA_ID )) { |
|
| 431 | - $state = EEM_State::instance()->get_one_by_ID( $STA_ID ); |
|
| 432 | - if ( $state instanceof EE_State ) { |
|
| 429 | + $STA_abbrev = is_array($cols_n_values) && isset($cols_n_values['STA_abbrev']) ? $cols_n_values['STA_abbrev'] : FALSE; |
|
| 430 | + if ( ! $STA_abbrev && ! empty($STA_ID)) { |
|
| 431 | + $state = EEM_State::instance()->get_one_by_ID($STA_ID); |
|
| 432 | + if ($state instanceof EE_State) { |
|
| 433 | 433 | $STA_abbrev = $state->abbrev(); |
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | - if ( ! $STA_abbrev ) { |
|
| 437 | - EE_Error::add_error( __( 'An invalid or missing State Abbreviation was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 436 | + if ( ! $STA_abbrev) { |
|
| 437 | + EE_Error::add_error(__('An invalid or missing State Abbreviation was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 438 | 438 | } |
| 439 | - EE_Error::dismiss_persistent_admin_notice( $CNT_ISO . '-' . $STA_abbrev, TRUE, TRUE ); |
|
| 439 | + EE_Error::dismiss_persistent_admin_notice($CNT_ISO.'-'.$STA_abbrev, TRUE, TRUE); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
@@ -448,17 +448,17 @@ discard block |
||
| 448 | 448 | * @param EE_State[] $state_options |
| 449 | 449 | * @return boolean |
| 450 | 450 | */ |
| 451 | - public static function state_options( $state_options = array() ) { |
|
| 451 | + public static function state_options($state_options = array()) { |
|
| 452 | 452 | $new_states = EE_Registry::instance()->SSN->get_session_data( |
| 453 | 453 | 'new_states' |
| 454 | 454 | ); |
| 455 | - if ( is_array( $new_states ) && ! empty( $new_states )) { |
|
| 456 | - foreach ( $new_states as $new_state ) { |
|
| 455 | + if (is_array($new_states) && ! empty($new_states)) { |
|
| 456 | + foreach ($new_states as $new_state) { |
|
| 457 | 457 | if ( |
| 458 | 458 | $new_state instanceof EE_State |
| 459 | 459 | && $new_state->country() instanceof EE_Country |
| 460 | 460 | ) { |
| 461 | - $state_options[ $new_state->country()->name() ][ $new_state->ID() ] = $new_state->name(); |
|
| 461 | + $state_options[$new_state->country()->name()][$new_state->ID()] = $new_state->name(); |
|
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -474,17 +474,17 @@ discard block |
||
| 474 | 474 | * @param EE_Country[] $country_options |
| 475 | 475 | * @return boolean |
| 476 | 476 | */ |
| 477 | - public static function country_options( $country_options = array() ) { |
|
| 477 | + public static function country_options($country_options = array()) { |
|
| 478 | 478 | $new_states = EE_Registry::instance()->SSN->get_session_data( |
| 479 | 479 | 'new_states' |
| 480 | 480 | ); |
| 481 | - if ( is_array( $new_states ) && ! empty( $new_states )) { |
|
| 482 | - foreach ( $new_states as $new_state ) { |
|
| 481 | + if (is_array($new_states) && ! empty($new_states)) { |
|
| 482 | + foreach ($new_states as $new_state) { |
|
| 483 | 483 | if ( |
| 484 | 484 | $new_state instanceof EE_State |
| 485 | 485 | && $new_state->country() instanceof EE_Country |
| 486 | 486 | ) { |
| 487 | - $country_options[ $new_state->country()->ID() ] = $new_state->country()->name(); |
|
| 487 | + $country_options[$new_state->country()->ID()] = $new_state->country()->name(); |
|
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @return EED_Module |
| 30 | 30 | */ |
| 31 | 31 | public static function instance() { |
| 32 | - return parent::get_instance( __CLASS__ ); |
|
| 32 | + return parent::get_instance(__CLASS__); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @access public |
| 61 | 61 | * @return void |
| 62 | 62 | */ |
| 63 | - public function run( $WP ) { |
|
| 63 | + public function run($WP) { |
|
| 64 | 64 | // add_filter( 'FHEE_load_ee_config', '__return_true' ); |
| 65 | 65 | // add_filter( 'FHEE_run_EE_wp', '__return_true' ); |
| 66 | 66 | // add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | * @return void |
| 80 | 80 | */ |
| 81 | 81 | public function certificate_launch() { |
| 82 | - if ( EE_Registry::instance()->REQ->is_set( 'id' ) && EE_Registry::instance()->REQ->is_set( 'r_id' )) { |
|
| 83 | - echo espresso_certificate_launch( EE_Registry::instance()->REQ->get( 'id' ), EE_Registry::instance()->REQ->get( 'r_id' )); |
|
| 82 | + if (EE_Registry::instance()->REQ->is_set('id') && EE_Registry::instance()->REQ->is_set('r_id')) { |
|
| 83 | + echo espresso_certificate_launch(EE_Registry::instance()->REQ->get('id'), EE_Registry::instance()->REQ->get('r_id')); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @access public |
| 115 | 115 | * @return void |
| 116 | 116 | */ |
| 117 | - public function the_content( $content ) { |
|
| 117 | + public function the_content($content) { |
|
| 118 | 118 | $content .= $this->ouput; |
| 119 | 119 | return $content; |
| 120 | 120 | } |
@@ -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 | * |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @return EED_Csv |
| 30 | 30 | */ |
| 31 | 31 | public static function instance() { |
| 32 | - return parent::get_instance( __CLASS__ ); |
|
| 32 | + return parent::get_instance(__CLASS__); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @access public |
| 61 | 61 | * @return void |
| 62 | 62 | */ |
| 63 | - public function run( $WP ) { |
|
| 63 | + public function run($WP) { |
|
| 64 | 64 | // add_filter( 'FHEE_load_ee_config', '__return_true' ); |
| 65 | 65 | // add_filter( 'FHEE_run_EE_wp', '__return_true' ); |
| 66 | 66 | // add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @return void |
| 80 | 80 | */ |
| 81 | 81 | public function export() { |
| 82 | - $Export = EE_Registry::instance()->load_class( 'Export' ); |
|
| 82 | + $Export = EE_Registry::instance()->load_class('Export'); |
|
| 83 | 83 | $Export->export(); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @return void |
| 94 | 94 | */ |
| 95 | 95 | public function import() { |
| 96 | - $Import = EE_Registry::instance()->load_class( 'Import' ); |
|
| 96 | + $Import = EE_Registry::instance()->load_class('Import'); |
|
| 97 | 97 | $Import->import(); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -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 | * |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @return EED_Event_Single |
| 30 | 30 | */ |
| 31 | 31 | public static function instance() { |
| 32 | - return parent::get_instance( __CLASS__ ); |
|
| 32 | + return parent::get_instance(__CLASS__); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | * @return void |
| 42 | 42 | */ |
| 43 | 43 | public static function set_hooks() { |
| 44 | - add_filter( 'FHEE_run_EE_wp', '__return_true' ); |
|
| 45 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
| 46 | - EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' ); |
|
| 44 | + add_filter('FHEE_run_EE_wp', '__return_true'); |
|
| 45 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
| 46 | + EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | 55 | public static function set_hooks_admin() { |
| 56 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
| 56 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | * @return void |
| 68 | 68 | */ |
| 69 | 69 | public static function set_definitions() { |
| 70 | - define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 71 | - define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
| 70 | + define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 71 | + define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return \EE_Events_Archive_Config |
| 80 | 80 | */ |
| 81 | - protected function set_config(){ |
|
| 82 | - $this->set_config_section( 'template_settings' ); |
|
| 83 | - $this->set_config_class( 'EE_Event_Single_Config' ); |
|
| 84 | - $this->set_config_name( 'EED_Event_Single' ); |
|
| 81 | + protected function set_config() { |
|
| 82 | + $this->set_config_section('template_settings'); |
|
| 83 | + $this->set_config_class('EE_Event_Single_Config'); |
|
| 84 | + $this->set_config_name('EED_Event_Single'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | * @param WP $WP |
| 94 | 94 | * @return void |
| 95 | 95 | */ |
| 96 | - public function run( $WP ) { |
|
| 96 | + public function run($WP) { |
|
| 97 | 97 | // ensure valid EE_Events_Archive_Config() object exists |
| 98 | 98 | $this->set_config(); |
| 99 | 99 | // check what template is loaded |
| 100 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
| 101 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
| 100 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
| 101 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
| 102 | 102 | // load css |
| 103 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
| 104 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
| 103 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
| 104 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
@@ -113,20 +113,20 @@ discard block |
||
| 113 | 113 | * @param string $template |
| 114 | 114 | * @return string |
| 115 | 115 | */ |
| 116 | - public function template_include( $template ) { |
|
| 116 | + public function template_include($template) { |
|
| 117 | 117 | global $post; |
| 118 | - if ( $this->config()->display_status_banner_single ) { |
|
| 119 | - add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 ); |
|
| 118 | + if ($this->config()->display_status_banner_single) { |
|
| 119 | + add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2); |
|
| 120 | 120 | } |
| 121 | 121 | // not a custom template? |
| 122 | - if ( EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' && ! post_password_required( $post ) ) { |
|
| 122 | + if (EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' && ! post_password_required($post)) { |
|
| 123 | 123 | EEH_Template::load_espresso_theme_functions(); |
| 124 | 124 | // then add extra event data via hooks |
| 125 | - add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' )); |
|
| 126 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 127 | - add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' )); |
|
| 125 | + add_action('loop_start', array('EED_Event_Single', 'loop_start')); |
|
| 126 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 127 | + add_action('loop_end', array('EED_Event_Single', 'loop_end')); |
|
| 128 | 128 | // don't display entry meta because the existing theme will take car of that |
| 129 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
| 129 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
| 130 | 130 | } |
| 131 | 131 | return $template; |
| 132 | 132 | } |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | * @param array $wp_query_array an array containing the WP_Query object |
| 141 | 141 | * @return void |
| 142 | 142 | */ |
| 143 | - public static function loop_start( $wp_query_array ) { |
|
| 143 | + public static function loop_start($wp_query_array) { |
|
| 144 | 144 | global $post; |
| 145 | - do_action( 'AHEE_event_details_before_post', $post, $wp_query_array ); |
|
| 145 | + do_action('AHEE_event_details_before_post', $post, $wp_query_array); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | * @param int $id |
| 156 | 156 | * @return string |
| 157 | 157 | */ |
| 158 | - public static function the_title( $title = '', $id = 0 ) { |
|
| 158 | + public static function the_title($title = '', $id = 0) { |
|
| 159 | 159 | global $post; |
| 160 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
| 160 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
@@ -168,28 +168,28 @@ discard block |
||
| 168 | 168 | * @param string $content |
| 169 | 169 | * @return string |
| 170 | 170 | */ |
| 171 | - public static function event_details( $content ) { |
|
| 171 | + public static function event_details($content) { |
|
| 172 | 172 | global $post; |
| 173 | - if ( $post->post_type == 'espresso_events' && ! post_password_required() ) { |
|
| 173 | + if ($post->post_type == 'espresso_events' && ! post_password_required()) { |
|
| 174 | 174 | // since the 'content-espresso_events-details.php' template might be used directly from within a theme, |
| 175 | 175 | // it uses the_content() for displaying the $post->post_content |
| 176 | 176 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
| 177 | 177 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
| 178 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 178 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 179 | 179 | //now add additional content |
| 180 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 ); |
|
| 181 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 ); |
|
| 182 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 ); |
|
| 180 | + add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1); |
|
| 181 | + add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1); |
|
| 182 | + add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1); |
|
| 183 | 183 | // now load our template |
| 184 | - $template = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
| 184 | + $template = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
| 185 | 185 | //now add our filter back in, plus some others |
| 186 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
| 187 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 ); |
|
| 188 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 ); |
|
| 189 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 ); |
|
| 186 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
| 187 | + remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110); |
|
| 188 | + remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120); |
|
| 189 | + remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130); |
|
| 190 | 190 | } |
| 191 | 191 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
| 192 | - return ! empty( $template ) ? $template : $content; |
|
| 192 | + return ! empty($template) ? $template : $content; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | * @param string $content |
| 202 | 202 | * @return string |
| 203 | 203 | */ |
| 204 | - public static function event_datetimes( $content ) { |
|
| 205 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
| 204 | + public static function event_datetimes($content) { |
|
| 205 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | * @param string $content |
| 213 | 213 | * @return string |
| 214 | 214 | */ |
| 215 | - public static function event_tickets( $content ) { |
|
| 216 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
| 215 | + public static function event_tickets($content) { |
|
| 216 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | * @param string $content |
| 224 | 224 | * @return string |
| 225 | 225 | */ |
| 226 | - public static function event_venues( $content ) { |
|
| 227 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
| 226 | + public static function event_venues($content) { |
|
| 227 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
@@ -236,9 +236,9 @@ discard block |
||
| 236 | 236 | * @param array $wp_query_array an array containing the WP_Query object |
| 237 | 237 | * @return void |
| 238 | 238 | */ |
| 239 | - public static function loop_end( $wp_query_array ) { |
|
| 239 | + public static function loop_end($wp_query_array) { |
|
| 240 | 240 | global $post; |
| 241 | - do_action( 'AHEE_event_details_after_post', $post, $wp_query_array ); |
|
| 241 | + do_action('AHEE_event_details_after_post', $post, $wp_query_array); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
@@ -251,18 +251,18 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function wp_enqueue_scripts() { |
| 253 | 253 | // get some style |
| 254 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) { |
|
| 255 | - EE_Registry::instance()->load_helper( 'File' ); |
|
| 254 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) { |
|
| 255 | + EE_Registry::instance()->load_helper('File'); |
|
| 256 | 256 | // first check uploads folder |
| 257 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
| 258 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
| 257 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
| 258 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
| 259 | 259 | } else { |
| 260 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
| 260 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
| 261 | 261 | } |
| 262 | - wp_enqueue_script( $this->theme ); |
|
| 263 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
| 264 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
| 265 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
| 262 | + wp_enqueue_script($this->theme); |
|
| 263 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
| 264 | + EE_Registry::instance()->load_helper('Maps'); |
|
| 265 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | } |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | * @return bool |
| 282 | 282 | */ |
| 283 | 283 | public static function display_venue() { |
| 284 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
| 284 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
| 285 | 285 | /** @type EE_Event_Single_Config EED_Event_Single::instance()->config() */ |
| 286 | - $display_venue= isset( EED_Event_Single::instance()->config()->display_venue ) ? EED_Event_Single::instance()->config()->display_venue : TRUE; |
|
| 286 | + $display_venue = isset(EED_Event_Single::instance()->config()->display_venue) ? EED_Event_Single::instance()->config()->display_venue : TRUE; |
|
| 287 | 287 | $venue_name = EEH_Venue_View::venue_name(); |
| 288 | - return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE; |
|
| 288 | + return $display_venue && ! empty($venue_name) ? TRUE : FALSE; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
@@ -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 | * |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @return EED_Events_Archive_Filters |
| 30 | 30 | */ |
| 31 | 31 | public static function instance() { |
| 32 | - return parent::get_instance( __CLASS__ ); |
|
| 32 | + return parent::get_instance(__CLASS__); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @var $_types |
| 72 | 72 | * @access protected |
| 73 | 73 | */ |
| 74 | - protected static $_types = array( 'grid', 'text', 'dates' ); |
|
| 74 | + protected static $_types = array('grid', 'text', 'dates'); |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | // public static $espresso_event_list_ID = 0; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @access public |
| 126 | 126 | * @return void |
| 127 | 127 | */ |
| 128 | - public function run( $WP ) { |
|
| 128 | + public function run($WP) { |
|
| 129 | 129 | // do_action( 'AHEE__EED_Events_Archive_Filters__before_run' ); |
| 130 | 130 | // // set config |
| 131 | 131 | // if ( ! isset( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters ) || ! EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters instanceof EE_Events_Archive_Config ) { |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | private function _filter_query_parts() { |
| 172 | 172 | // build event list query |
| 173 | - add_filter( 'posts_join', array( $this, 'posts_join' ), 1, 2 ); |
|
| 174 | - add_filter( 'posts_where', array( $this, 'posts_where' ), 1, 2 ); |
|
| 175 | - add_filter( 'posts_orderby', array( $this, 'posts_orderby' ), 1, 2 ); |
|
| 173 | + add_filter('posts_join', array($this, 'posts_join'), 1, 2); |
|
| 174 | + add_filter('posts_where', array($this, 'posts_where'), 1, 2); |
|
| 175 | + add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -182,13 +182,13 @@ discard block |
||
| 182 | 182 | * @return string |
| 183 | 183 | */ |
| 184 | 184 | public static function set_type() { |
| 185 | - do_action( 'AHEE__EED_Events_Archive_Filters__before_set_type' ); |
|
| 186 | - EED_Events_Archive_Filters::$_types = apply_filters( 'EED_Events_Archive_Filters__set_type__types', EED_Events_Archive_Filters::$_types ); |
|
| 187 | - $view = isset( EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type'] ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type'] : 'grid'; |
|
| 188 | - $elf_type = EE_Registry::instance()->REQ->is_set( 'elf_type' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_type' )) : ''; |
|
| 189 | - $view = ! empty( $elf_type ) ? $elf_type : $view; |
|
| 190 | - $view = apply_filters( 'EED_Events_Archive_Filters__set_type__type', $view ); |
|
| 191 | - if ( ! empty( $view ) && in_array( $view, EED_Events_Archive_Filters::$_types )) { |
|
| 185 | + do_action('AHEE__EED_Events_Archive_Filters__before_set_type'); |
|
| 186 | + EED_Events_Archive_Filters::$_types = apply_filters('EED_Events_Archive_Filters__set_type__types', EED_Events_Archive_Filters::$_types); |
|
| 187 | + $view = isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type']) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type'] : 'grid'; |
|
| 188 | + $elf_type = EE_Registry::instance()->REQ->is_set('elf_type') ? sanitize_text_field(EE_Registry::instance()->REQ->get('elf_type')) : ''; |
|
| 189 | + $view = ! empty($elf_type) ? $elf_type : $view; |
|
| 190 | + $view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view); |
|
| 191 | + if ( ! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) { |
|
| 192 | 192 | self::$_type = $view; |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -200,11 +200,11 @@ discard block |
||
| 200 | 200 | * @param boolean $req_only if TRUE, then ignore defaults and only return $_POST value |
| 201 | 201 | * @return boolean |
| 202 | 202 | */ |
| 203 | - private static function _show_expired( $req_only = FALSE ) { |
|
| 203 | + private static function _show_expired($req_only = FALSE) { |
|
| 204 | 204 | // get default value for "display_expired_events" as set in the EE General Settings > Templates > Event Listings |
| 205 | - $show_expired = ! $req_only && isset( EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : FALSE; |
|
| 205 | + $show_expired = ! $req_only && isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events']) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : FALSE; |
|
| 206 | 206 | // override default expired option if set via filter |
| 207 | - $show_expired = EE_Registry::instance()->REQ->is_set( 'elf_expired_chk' ) ? absint( EE_Registry::instance()->REQ->get( 'elf_expired_chk' )) : $show_expired; |
|
| 207 | + $show_expired = EE_Registry::instance()->REQ->is_set('elf_expired_chk') ? absint(EE_Registry::instance()->REQ->get('elf_expired_chk')) : $show_expired; |
|
| 208 | 208 | return $show_expired ? TRUE : FALSE; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * @return string |
| 216 | 216 | */ |
| 217 | 217 | private static function _event_category_slug() { |
| 218 | - return EE_Registry::instance()->REQ->is_set( 'elf_category_dd' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_category_dd' )) : ''; |
|
| 218 | + return EE_Registry::instance()->REQ->is_set('elf_category_dd') ? sanitize_text_field(EE_Registry::instance()->REQ->get('elf_category_dd')) : ''; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @return string |
| 226 | 226 | */ |
| 227 | 227 | private static function _display_month() { |
| 228 | - return EE_Registry::instance()->REQ->is_set( 'elf_month_dd' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_month_dd' )) : ''; |
|
| 228 | + return EE_Registry::instance()->REQ->is_set('elf_month_dd') ? sanitize_text_field(EE_Registry::instance()->REQ->get('elf_month_dd')) : ''; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | public function get_post_data() { |
| 240 | 240 | $this->_elf_month = EED_Events_Archive_Filters::_display_month(); |
| 241 | 241 | $this->_elf_category = EED_Events_Archive_Filters::_event_category_slug(); |
| 242 | - $this->_show_expired = EED_Events_Archive_Filters::_show_expired( TRUE ); |
|
| 242 | + $this->_show_expired = EED_Events_Archive_Filters::_show_expired(TRUE); |
|
| 243 | 243 | // EEH_Debug_Tools::printr( EE_Registry::instance()->REQ, 'EE_Registry::instance()->REQ <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 244 | 244 | // echo '<h4>$this->_elf_month : ' . $this->_elf_month . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
| 245 | 245 | // echo '<h4>$this->_elf_category : ' . $this->_elf_category . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | * @access public |
| 257 | 257 | * @return void |
| 258 | 258 | */ |
| 259 | - public function posts_join( $SQL, WP_Query $wp_query ) { |
|
| 260 | - if ( isset( $wp_query->query ) && isset( $wp_query->query['post_type'] ) && $wp_query->query['post_type'] == 'espresso_events' ) { |
|
| 259 | + public function posts_join($SQL, WP_Query $wp_query) { |
|
| 260 | + if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') { |
|
| 261 | 261 | // Category |
| 262 | 262 | // $elf_category = EE_Registry::instance()->REQ->is_set( 'elf_category_dd' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_category_dd' )) : ''; |
| 263 | - $SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms( EED_Events_Archive_Filters::_event_category_slug() ); |
|
| 263 | + $SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms(EED_Events_Archive_Filters::_event_category_slug()); |
|
| 264 | 264 | } |
| 265 | 265 | return $SQL; |
| 266 | 266 | } |
@@ -273,9 +273,9 @@ discard block |
||
| 273 | 273 | * @param mixed boolean|string $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet |
| 274 | 274 | * @return string |
| 275 | 275 | */ |
| 276 | - public static function posts_join_sql_for_terms( $join_terms = NULL ) { |
|
| 277 | - $SQL= ''; |
|
| 278 | - if ( ! empty( $join_terms )) { |
|
| 276 | + public static function posts_join_sql_for_terms($join_terms = NULL) { |
|
| 277 | + $SQL = ''; |
|
| 278 | + if ( ! empty($join_terms)) { |
|
| 279 | 279 | global $wpdb; |
| 280 | 280 | $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
| 281 | 281 | $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
@@ -293,28 +293,28 @@ discard block |
||
| 293 | 293 | * @param array $orderby_params |
| 294 | 294 | * @return string |
| 295 | 295 | */ |
| 296 | - public static function posts_join_for_orderby( $orderby_params = array() ) { |
|
| 296 | + public static function posts_join_for_orderby($orderby_params = array()) { |
|
| 297 | 297 | global $wpdb; |
| 298 | - $SQL= ''; |
|
| 299 | - $orderby_params = is_array( $orderby_params ) ? $orderby_params : array( $orderby_params ); |
|
| 300 | - foreach( $orderby_params as $orderby ) { |
|
| 301 | - switch ( $orderby ) { |
|
| 298 | + $SQL = ''; |
|
| 299 | + $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params); |
|
| 300 | + foreach ($orderby_params as $orderby) { |
|
| 301 | + switch ($orderby) { |
|
| 302 | 302 | |
| 303 | 303 | case 'ticket_start' : |
| 304 | 304 | case 'ticket_end' : |
| 305 | - $SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON (' . EEM_Datetime::instance()->table() . '.DTT_ID = ' . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )'; |
|
| 306 | - $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = ' . EEM_Ticket::instance()->table() . '.TKT_ID )'; |
|
| 305 | + $SQL .= ' LEFT JOIN '.EEM_Datetime_Ticket::instance()->table().' ON ('.EEM_Datetime::instance()->table().'.DTT_ID = '.EEM_Datetime_Ticket::instance()->table().'.DTT_ID )'; |
|
| 306 | + $SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table().' ON ('.EEM_Datetime_Ticket::instance()->table().'.TKT_ID = '.EEM_Ticket::instance()->table().'.TKT_ID )'; |
|
| 307 | 307 | break; |
| 308 | 308 | |
| 309 | 309 | case 'venue_title' : |
| 310 | 310 | case 'city' : |
| 311 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
| 312 | - $SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON (' . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' . EEM_Venue::instance()->table() . '.VNU_ID )'; |
|
| 311 | + $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = '.EEM_Event_Venue::instance()->table().'.EVT_ID )'; |
|
| 312 | + $SQL .= ' LEFT JOIN '.EEM_Venue::instance()->table().' ON ('.EEM_Event_Venue::instance()->table().'.VNU_ID = '.EEM_Venue::instance()->table().'.VNU_ID )'; |
|
| 313 | 313 | break; |
| 314 | 314 | |
| 315 | 315 | case 'state' : |
| 316 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' . EEM_Event_Venue::instance()->table() . '.EVT_ID )'; |
|
| 317 | - $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON (' . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )'; |
|
| 316 | + $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = '.EEM_Event_Venue::instance()->table().'.EVT_ID )'; |
|
| 317 | + $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->second_table().' ON ('.EEM_Event_Venue::instance()->table().'.VNU_ID = '.EEM_Event_Venue::instance()->second_table().'.VNU_ID )'; |
|
| 318 | 318 | break; |
| 319 | 319 | |
| 320 | 320 | break; |
@@ -331,16 +331,16 @@ discard block |
||
| 331 | 331 | * @access public |
| 332 | 332 | * @return void |
| 333 | 333 | */ |
| 334 | - public function posts_where( $SQL, WP_Query $wp_query ) { |
|
| 335 | - if ( isset( $wp_query->query_vars ) && isset( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] == 'espresso_events' ) { |
|
| 334 | + public function posts_where($SQL, WP_Query $wp_query) { |
|
| 335 | + if (isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'espresso_events') { |
|
| 336 | 336 | // Show Expired ? |
| 337 | - $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired( EED_Events_Archive_Filters::_show_expired() ); |
|
| 337 | + $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired(EED_Events_Archive_Filters::_show_expired()); |
|
| 338 | 338 | // Category |
| 339 | 339 | //$elf_category = EED_Events_Archive_Filters::_event_category_slug(); |
| 340 | - $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug( EED_Events_Archive_Filters::_event_category_slug() ); |
|
| 340 | + $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug(EED_Events_Archive_Filters::_event_category_slug()); |
|
| 341 | 341 | // Start Date |
| 342 | 342 | //$elf_month = EED_Events_Archive_Filters::_display_month(); |
| 343 | - $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month( EED_Events_Archive_Filters::_display_month() ); |
|
| 343 | + $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month(EED_Events_Archive_Filters::_display_month()); |
|
| 344 | 344 | } |
| 345 | 345 | return $SQL; |
| 346 | 346 | } |
@@ -353,8 +353,8 @@ discard block |
||
| 353 | 353 | * @param boolean $show_expired if TRUE, then displayed past events |
| 354 | 354 | * @return string |
| 355 | 355 | */ |
| 356 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
| 357 | - return ! $show_expired ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" ' : ''; |
|
| 356 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
| 357 | + return ! $show_expired ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > "'.date('Y-m-d H:s:i').'" ' : ''; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
@@ -365,9 +365,9 @@ discard block |
||
| 365 | 365 | * @param boolean $event_category_slug |
| 366 | 366 | * @return string |
| 367 | 367 | */ |
| 368 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
| 368 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
| 369 | 369 | global $wpdb; |
| 370 | - return ! empty( $event_category_slug ) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : ''; |
|
| 370 | + return ! empty($event_category_slug) ? ' AND '.$wpdb->terms.'.slug = "'.$event_category_slug.'" ' : ''; |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -377,13 +377,13 @@ discard block |
||
| 377 | 377 | * @param boolean $month |
| 378 | 378 | * @return string |
| 379 | 379 | */ |
| 380 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
| 381 | - $SQL= ''; |
|
| 382 | - if ( ! empty( $month )) { |
|
| 380 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
| 381 | + $SQL = ''; |
|
| 382 | + if ( ! empty($month)) { |
|
| 383 | 383 | // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
| 384 | - $SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start <= "' . date('Y-m-t 23:59:59', strtotime( $month )) . '"'; |
|
| 384 | + $SQL = ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_start <= "'.date('Y-m-t 23:59:59', strtotime($month)).'"'; |
|
| 385 | 385 | // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
| 386 | - $SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end >= "' . date('Y-m-d 0:0:00', strtotime( $month )) . '" '; |
|
| 386 | + $SQL .= ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end >= "'.date('Y-m-d 0:0:00', strtotime($month)).'" '; |
|
| 387 | 387 | } |
| 388 | 388 | return $SQL; |
| 389 | 389 | } |
@@ -395,9 +395,9 @@ discard block |
||
| 395 | 395 | * @access public |
| 396 | 396 | * @return void |
| 397 | 397 | */ |
| 398 | - public function posts_orderby( $SQL, WP_Query $wp_query ) { |
|
| 399 | - if ( isset( $wp_query->query ) && isset( $wp_query->query['post_type'] ) && $wp_query->query['post_type'] == 'espresso_events' ) { |
|
| 400 | - $SQL = EED_Events_Archive_Filters::posts_orderby_sql( array( 'start_date' )); |
|
| 398 | + public function posts_orderby($SQL, WP_Query $wp_query) { |
|
| 399 | + if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') { |
|
| 400 | + $SQL = EED_Events_Archive_Filters::posts_orderby_sql(array('start_date')); |
|
| 401 | 401 | } |
| 402 | 402 | return $SQL; |
| 403 | 403 | } |
@@ -426,54 +426,54 @@ discard block |
||
| 426 | 426 | * @param boolean $orderby_params |
| 427 | 427 | * @return string |
| 428 | 428 | */ |
| 429 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
| 429 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
| 430 | 430 | global $wpdb; |
| 431 | 431 | $SQL = ''; |
| 432 | 432 | $cntr = 1; |
| 433 | - $orderby_params = is_array( $orderby_params ) ? $orderby_params : array( $orderby_params ); |
|
| 434 | - foreach( $orderby_params as $orderby ) { |
|
| 435 | - $glue = $cntr == 1 || $cntr == count( $orderby_params ) ? ' ' : ', '; |
|
| 436 | - switch ( $orderby ) { |
|
| 433 | + $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params); |
|
| 434 | + foreach ($orderby_params as $orderby) { |
|
| 435 | + $glue = $cntr == 1 || $cntr == count($orderby_params) ? ' ' : ', '; |
|
| 436 | + switch ($orderby) { |
|
| 437 | 437 | |
| 438 | 438 | case 'id' : |
| 439 | 439 | case 'ID' : |
| 440 | - $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
| 440 | + $SQL .= $glue.$wpdb->posts.'.ID '.$sort; |
|
| 441 | 441 | break; |
| 442 | 442 | |
| 443 | 443 | case 'start_date' : |
| 444 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort; |
|
| 444 | + $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_start '.$sort; |
|
| 445 | 445 | break; |
| 446 | 446 | |
| 447 | 447 | case 'end_date' : |
| 448 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
| 448 | + $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort; |
|
| 449 | 449 | break; |
| 450 | 450 | |
| 451 | 451 | case 'event_name' : |
| 452 | - $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
| 452 | + $SQL .= $glue.$wpdb->posts.'.post_title '.$sort; |
|
| 453 | 453 | break; |
| 454 | 454 | |
| 455 | 455 | case 'category_slug' : |
| 456 | - $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
| 456 | + $SQL .= $glue.$wpdb->terms.'.slug '.$sort; |
|
| 457 | 457 | break; |
| 458 | 458 | |
| 459 | 459 | case 'ticket_start' : |
| 460 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
| 460 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort; |
|
| 461 | 461 | break; |
| 462 | 462 | |
| 463 | 463 | case 'ticket_end' : |
| 464 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
| 464 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort; |
|
| 465 | 465 | break; |
| 466 | 466 | |
| 467 | 467 | case 'venue_title' : |
| 468 | - $SQL .= $glue . 'venue_title ' . $sort; |
|
| 468 | + $SQL .= $glue.'venue_title '.$sort; |
|
| 469 | 469 | break; |
| 470 | 470 | |
| 471 | 471 | case 'city' : |
| 472 | - $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
| 472 | + $SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort; |
|
| 473 | 473 | break; |
| 474 | 474 | |
| 475 | 475 | case 'state' : |
| 476 | - $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
| 476 | + $SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort; |
|
| 477 | 477 | break; |
| 478 | 478 | |
| 479 | 479 | } |
@@ -493,26 +493,26 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | public function template_redirect() { |
| 495 | 495 | // add event list filters |
| 496 | - add_action( 'loop_start', array( $this, 'event_list_template_filters' )); |
|
| 496 | + add_action('loop_start', array($this, 'event_list_template_filters')); |
|
| 497 | 497 | // and pagination |
| 498 | - add_action( 'loop_start', array( $this, 'event_list_pagination' )); |
|
| 499 | - add_action( 'loop_end', array( $this, 'event_list_pagination' )); |
|
| 498 | + add_action('loop_start', array($this, 'event_list_pagination')); |
|
| 499 | + add_action('loop_end', array($this, 'event_list_pagination')); |
|
| 500 | 500 | // if NOT a custom template |
| 501 | - if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php' ) { |
|
| 501 | + if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php') { |
|
| 502 | 502 | // don't know if theme uses the_excerpt |
| 503 | - add_filter( 'the_excerpt', array( $this, 'event_details' ), 100 ); |
|
| 504 | - add_filter( 'the_excerpt', array( $this, 'event_tickets' ), 110 ); |
|
| 505 | - add_filter( 'the_excerpt', array( $this, 'event_datetimes' ), 120 ); |
|
| 506 | - add_filter( 'the_excerpt', array( $this, 'event_venues' ), 130 ); |
|
| 503 | + add_filter('the_excerpt', array($this, 'event_details'), 100); |
|
| 504 | + add_filter('the_excerpt', array($this, 'event_tickets'), 110); |
|
| 505 | + add_filter('the_excerpt', array($this, 'event_datetimes'), 120); |
|
| 506 | + add_filter('the_excerpt', array($this, 'event_venues'), 130); |
|
| 507 | 507 | // or the_content |
| 508 | - add_filter( 'the_content', array( $this, 'event_details' ), 100 ); |
|
| 509 | - add_filter( 'the_content', array( $this, 'event_tickets' ), 110 ); |
|
| 510 | - add_filter( 'the_content', array( $this, 'event_datetimes' ), 120 ); |
|
| 511 | - add_filter( 'the_content', array( $this, 'event_venues' ), 130 ); |
|
| 508 | + add_filter('the_content', array($this, 'event_details'), 100); |
|
| 509 | + add_filter('the_content', array($this, 'event_tickets'), 110); |
|
| 510 | + add_filter('the_content', array($this, 'event_datetimes'), 120); |
|
| 511 | + add_filter('the_content', array($this, 'event_venues'), 130); |
|
| 512 | 512 | } else { |
| 513 | - remove_all_filters( 'excerpt_length' ); |
|
| 514 | - add_filter( 'excerpt_length', array( $this, 'excerpt_length' ), 10 ); |
|
| 515 | - add_filter( 'excerpt_more', array( $this, 'excerpt_more' ), 10 ); |
|
| 513 | + remove_all_filters('excerpt_length'); |
|
| 514 | + add_filter('excerpt_length', array($this, 'excerpt_length'), 10); |
|
| 515 | + add_filter('excerpt_more', array($this, 'excerpt_more'), 10); |
|
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | * @return void |
| 526 | 526 | */ |
| 527 | 527 | public function event_list_pagination() { |
| 528 | - echo '<div class="ee-pagination-dv clear">' . espresso_event_list_pagination() . '</div>'; |
|
| 528 | + echo '<div class="ee-pagination-dv clear">'.espresso_event_list_pagination().'</div>'; |
|
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
@@ -536,8 +536,8 @@ discard block |
||
| 536 | 536 | * @param string $content |
| 537 | 537 | * @return void |
| 538 | 538 | */ |
| 539 | - public function event_details( $content ) { |
|
| 540 | - return EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-details.php', array( 'the_content' => $content ), TRUE ); |
|
| 539 | + public function event_details($content) { |
|
| 540 | + return EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-details.php', array('the_content' => $content), TRUE); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | |
@@ -548,8 +548,8 @@ discard block |
||
| 548 | 548 | * @param string $content |
| 549 | 549 | * @return void |
| 550 | 550 | */ |
| 551 | - public function event_tickets( $content ) { |
|
| 552 | - return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-tickets.php', array(), TRUE ); |
|
| 551 | + public function event_tickets($content) { |
|
| 552 | + return $content.EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-tickets.php', array(), TRUE); |
|
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | /** |
@@ -559,8 +559,8 @@ discard block |
||
| 559 | 559 | * @param string $content |
| 560 | 560 | * @return void |
| 561 | 561 | */ |
| 562 | - public function event_datetimes( $content ) { |
|
| 563 | - return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-datetimes.php', array(), TRUE ); |
|
| 562 | + public function event_datetimes($content) { |
|
| 563 | + return $content.EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-datetimes.php', array(), TRUE); |
|
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | /** |
@@ -570,8 +570,8 @@ discard block |
||
| 570 | 570 | * @param string $content |
| 571 | 571 | * @return void |
| 572 | 572 | */ |
| 573 | - public function event_venues( $content ) { |
|
| 574 | - return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-venues.php', array(), TRUE ); |
|
| 573 | + public function event_venues($content) { |
|
| 574 | + return $content.EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-venues.php', array(), TRUE); |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | |
@@ -586,16 +586,16 @@ discard block |
||
| 586 | 586 | * @return void |
| 587 | 587 | */ |
| 588 | 588 | private function _load_assests() { |
| 589 | - do_action( 'AHEE__EED_Events_Archive_Filters__before_load_assests' ); |
|
| 590 | - add_filter( 'FHEE_load_css', '__return_true' ); |
|
| 591 | - add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
|
| 592 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
| 593 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
| 594 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
| 595 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
| 589 | + do_action('AHEE__EED_Events_Archive_Filters__before_load_assests'); |
|
| 590 | + add_filter('FHEE_load_css', '__return_true'); |
|
| 591 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
| 592 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
| 593 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
| 594 | + EE_Registry::instance()->load_helper('Maps'); |
|
| 595 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
| 596 | 596 | } |
| 597 | 597 | //add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 ); |
| 598 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
| 598 | + EE_Registry::instance()->load_helper('Event_View'); |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | |
@@ -608,8 +608,8 @@ discard block |
||
| 608 | 608 | * @access private |
| 609 | 609 | * @return string |
| 610 | 610 | */ |
| 611 | - private function _get_template( $which = 'part' ) { |
|
| 612 | - return EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
| 611 | + private function _get_template($which = 'part') { |
|
| 612 | + return EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php'; |
|
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | |
@@ -620,13 +620,13 @@ discard block |
||
| 620 | 620 | * @access public |
| 621 | 621 | * @return void |
| 622 | 622 | */ |
| 623 | - public function excerpt_length( $length ) { |
|
| 623 | + public function excerpt_length($length) { |
|
| 624 | 624 | |
| 625 | - if ( self::$_type == 'grid' ) { |
|
| 625 | + if (self::$_type == 'grid') { |
|
| 626 | 626 | return 36; |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | - switch ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size ) { |
|
| 629 | + switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) { |
|
| 630 | 630 | case 'tiny' : |
| 631 | 631 | return 12; |
| 632 | 632 | break; |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | * @access public |
| 651 | 651 | * @return void |
| 652 | 652 | */ |
| 653 | - public function excerpt_more( $more ) { |
|
| 653 | + public function excerpt_more($more) { |
|
| 654 | 654 | return '…'; |
| 655 | 655 | } |
| 656 | 656 | |
@@ -680,23 +680,23 @@ discard block |
||
| 680 | 680 | */ |
| 681 | 681 | public function wp_enqueue_scripts() { |
| 682 | 682 | // get some style |
| 683 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) { |
|
| 683 | + if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) { |
|
| 684 | 684 | // first check uploads folder |
| 685 | - EE_Registry::instance()->load_helper( 'File' ); |
|
| 686 | - if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css' )) { |
|
| 687 | - wp_register_style( 'archive-espresso_events', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', array( 'dashicons', 'espresso_default' )); |
|
| 685 | + EE_Registry::instance()->load_helper('File'); |
|
| 686 | + if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.css')) { |
|
| 687 | + wp_register_style('archive-espresso_events', get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'archive-espresso_events.css', array('dashicons', 'espresso_default')); |
|
| 688 | 688 | } else { |
| 689 | - wp_register_style( 'archive-espresso_events', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', array( 'dashicons', 'espresso_default' )); |
|
| 689 | + wp_register_style('archive-espresso_events', EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'archive-espresso_events.css', array('dashicons', 'espresso_default')); |
|
| 690 | 690 | } |
| 691 | - if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js' )) { |
|
| 692 | - wp_register_script( 'archive-espresso_events', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js', array( 'jquery-masonry' ), '1.0', TRUE ); |
|
| 691 | + if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.js')) { |
|
| 692 | + wp_register_script('archive-espresso_events', get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'archive-espresso_events.js', array('jquery-masonry'), '1.0', TRUE); |
|
| 693 | 693 | } else { |
| 694 | - wp_register_script( 'archive-espresso_events', EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js', array( 'jquery-masonry' ), '1.0', TRUE ); |
|
| 694 | + wp_register_script('archive-espresso_events', EVENTS_ARCHIVE_ASSETS_URL.'archive-espresso_events.js', array('jquery-masonry'), '1.0', TRUE); |
|
| 695 | 695 | } |
| 696 | - wp_enqueue_style( 'archive-espresso_events' ); |
|
| 697 | - wp_enqueue_script( 'jquery-masonry' ); |
|
| 698 | - wp_enqueue_script( 'archive-espresso_events' ); |
|
| 699 | - add_action( 'wp_footer', array( 'EED_Events_Archive_Filters', 'localize_grid_event_lists' ), 1 ); |
|
| 696 | + wp_enqueue_style('archive-espresso_events'); |
|
| 697 | + wp_enqueue_script('jquery-masonry'); |
|
| 698 | + wp_enqueue_script('archive-espresso_events'); |
|
| 699 | + add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1); |
|
| 700 | 700 | } |
| 701 | 701 | } |
| 702 | 702 | |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | * @return void |
| 712 | 712 | */ |
| 713 | 713 | public static function localize_grid_event_lists() { |
| 714 | - wp_localize_script( 'archive-espresso_events', 'espresso_grid_event_lists', EED_Events_Archive_Filters::$espresso_grid_event_lists ); |
|
| 714 | + wp_localize_script('archive-espresso_events', 'espresso_grid_event_lists', EED_Events_Archive_Filters::$espresso_grid_event_lists); |
|
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | |
@@ -726,9 +726,9 @@ discard block |
||
| 726 | 726 | */ |
| 727 | 727 | public static function template_settings_form() { |
| 728 | 728 | $EE = EE_Registry::instance(); |
| 729 | - $EE->CFG->template_settings->EED_Events_Archive_Filters = isset( $EE->CFG->template_settings->EED_Events_Archive_Filters ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config(); |
|
| 730 | - $EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters( 'FHEE__Event_List__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Events_Archive_Filters ); |
|
| 731 | - EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $EE->CFG->template_settings->EED_Events_Archive_Filters ); |
|
| 729 | + $EE->CFG->template_settings->EED_Events_Archive_Filters = isset($EE->CFG->template_settings->EED_Events_Archive_Filters) ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config(); |
|
| 730 | + $EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters('FHEE__Event_List__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Events_Archive_Filters); |
|
| 731 | + EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $EE->CFG->template_settings->EED_Events_Archive_Filters); |
|
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | |
@@ -742,16 +742,16 @@ discard block |
||
| 742 | 742 | * @static |
| 743 | 743 | * @return void |
| 744 | 744 | */ |
| 745 | - public static function set_default_settings( $CFG ) { |
|
| 745 | + public static function set_default_settings($CFG) { |
|
| 746 | 746 | //EEH_Debug_Tools::printr( $CFG, '$CFG <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 747 | - $CFG->display_description = isset( $CFG->display_description ) && ! empty( $CFG->display_description ) ? $CFG->display_description : 1; |
|
| 748 | - $CFG->display_address = isset( $CFG->display_address ) && ! empty( $CFG->display_address ) ? $CFG->display_address : TRUE; |
|
| 749 | - $CFG->display_venue_details = isset( $CFG->display_venue_details ) && ! empty( $CFG->display_venue_details ) ? $CFG->display_venue_details : TRUE; |
|
| 750 | - $CFG->display_expired_events = isset( $CFG->display_expired_events ) && ! empty( $CFG->display_expired_events ) ? $CFG->display_expired_events : FALSE; |
|
| 751 | - $CFG->default_type = isset( $CFG->default_type ) && ! empty( $CFG->default_type ) ? $CFG->default_type : 'grid'; |
|
| 752 | - $CFG->event_list_grid_size = isset( $CFG->event_list_grid_size ) && ! empty( $CFG->event_list_grid_size ) ? $CFG->event_list_grid_size : 'medium'; |
|
| 753 | - $CFG->templates['full'] = isset( $CFG->templates['full'] ) && ! empty( $CFG->templates['full'] ) ? $CFG->templates['full'] : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'; |
|
| 754 | - $CFG->templates['part'] = isset( $CFG->templates['part'] ) && ! empty( $CFG->templates['part'] ) ? $CFG->templates['part'] : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php'; |
|
| 747 | + $CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description) ? $CFG->display_description : 1; |
|
| 748 | + $CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address : TRUE; |
|
| 749 | + $CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details) ? $CFG->display_venue_details : TRUE; |
|
| 750 | + $CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events) ? $CFG->display_expired_events : FALSE; |
|
| 751 | + $CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid'; |
|
| 752 | + $CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size) ? $CFG->event_list_grid_size : 'medium'; |
|
| 753 | + $CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full']) ? $CFG->templates['full'] : EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php'; |
|
| 754 | + $CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part']) ? $CFG->templates['part'] : EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-grid-view.php'; |
|
| 755 | 755 | return $CFG; |
| 756 | 756 | } |
| 757 | 757 | |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | * @access public |
| 764 | 764 | * @return void |
| 765 | 765 | */ |
| 766 | - public function filter_config( $CFG ) { |
|
| 766 | + public function filter_config($CFG) { |
|
| 767 | 767 | return $CFG; |
| 768 | 768 | } |
| 769 | 769 | |
@@ -776,32 +776,32 @@ discard block |
||
| 776 | 776 | * @access public |
| 777 | 777 | * @return void |
| 778 | 778 | */ |
| 779 | - public static function update_template_settings( $CFG, $REQ ) { |
|
| 779 | + public static function update_template_settings($CFG, $REQ) { |
|
| 780 | 780 | // EEH_Debug_Tools::printr( $REQ, '$REQ <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 781 | 781 | // EEH_Debug_Tools::printr( $CFG, '$CFG <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 782 | 782 | //$CFG->template_settings->EED_Events_Archive_Filters = new stdClass(); |
| 783 | - $CFG->EED_Events_Archive_Filters->display_description = isset( $REQ['display_description_in_event_list'] ) ? absint( $REQ['display_description_in_event_list'] ) : 1; |
|
| 784 | - $CFG->EED_Events_Archive_Filters->display_address = isset( $REQ['display_address_in_event_list'] ) ? absint( $REQ['display_address_in_event_list'] ) : TRUE; |
|
| 785 | - $CFG->EED_Events_Archive_Filters->display_venue_details = isset( $REQ['display_venue_details_in_event_list'] ) ? absint( $REQ['display_venue_details_in_event_list'] ) : TRUE; |
|
| 786 | - $CFG->EED_Events_Archive_Filters->display_expired_events = isset( $REQ['display_expired_events'] ) ? absint( $REQ['display_expired_events'] ) : FALSE; |
|
| 787 | - $CFG->EED_Events_Archive_Filters->default_type = isset( $REQ['default_type'] ) ? sanitize_text_field( $REQ['default_type'] ) : 'grid'; |
|
| 788 | - $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset( $REQ['event_list_grid_size'] ) ? sanitize_text_field( $REQ['event_list_grid_size'] ) : 'medium'; |
|
| 783 | + $CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list']) ? absint($REQ['display_description_in_event_list']) : 1; |
|
| 784 | + $CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint($REQ['display_address_in_event_list']) : TRUE; |
|
| 785 | + $CFG->EED_Events_Archive_Filters->display_venue_details = isset($REQ['display_venue_details_in_event_list']) ? absint($REQ['display_venue_details_in_event_list']) : TRUE; |
|
| 786 | + $CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint($REQ['display_expired_events']) : FALSE; |
|
| 787 | + $CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field($REQ['default_type']) : 'grid'; |
|
| 788 | + $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size']) ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium'; |
|
| 789 | 789 | $CFG->EED_Events_Archive_Filters->templates = array( |
| 790 | - 'full' => EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php' |
|
| 790 | + 'full' => EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php' |
|
| 791 | 791 | ); |
| 792 | 792 | |
| 793 | - switch ( $CFG->EED_Events_Archive_Filters->default_type ) { |
|
| 793 | + switch ($CFG->EED_Events_Archive_Filters->default_type) { |
|
| 794 | 794 | case 'dates' : |
| 795 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-dates-view.php'; |
|
| 795 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-dates-view.php'; |
|
| 796 | 796 | break; |
| 797 | 797 | case 'text' : |
| 798 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-text-view.php'; |
|
| 798 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-text-view.php'; |
|
| 799 | 799 | break; |
| 800 | 800 | default : |
| 801 | - $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php'; |
|
| 801 | + $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-grid-view.php'; |
|
| 802 | 802 | } |
| 803 | 803 | |
| 804 | - $CFG->EED_Events_Archive_Filters = isset( $REQ['reset_event_list_settings'] ) && absint( $REQ['reset_event_list_settings'] ) == 1 ? new EE_Events_Archive_Config() : $CFG->EED_Events_Archive_Filters; |
|
| 804 | + $CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings']) && absint($REQ['reset_event_list_settings']) == 1 ? new EE_Events_Archive_Config() : $CFG->EED_Events_Archive_Filters; |
|
| 805 | 805 | return $CFG; |
| 806 | 806 | } |
| 807 | 807 | |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | * @return void |
| 817 | 817 | */ |
| 818 | 818 | public static function get_template_part() { |
| 819 | - switch ( self::$_type ) { |
|
| 819 | + switch (self::$_type) { |
|
| 820 | 820 | case 'dates' : |
| 821 | 821 | return 'archive-espresso_events-dates-view.php'; |
| 822 | 822 | break; |
@@ -840,13 +840,13 @@ discard block |
||
| 840 | 840 | */ |
| 841 | 841 | public function event_list_template_filters() { |
| 842 | 842 | $args = array( |
| 843 | - 'form_url' => get_post_type_archive_link( 'espresso_events' ), //add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ), |
|
| 843 | + 'form_url' => get_post_type_archive_link('espresso_events'), //add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ), |
|
| 844 | 844 | 'elf_month' => EED_Events_Archive_Filters::_display_month(), |
| 845 | 845 | 'elf_category' => EED_Events_Archive_Filters::_event_category_slug(), |
| 846 | 846 | 'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(), |
| 847 | 847 | 'elf_type' => self::$_type |
| 848 | 848 | ); |
| 849 | - EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-filters.php', $args ); |
|
| 849 | + EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-filters.php', $args); |
|
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | |
@@ -859,16 +859,16 @@ discard block |
||
| 859 | 859 | * @access public |
| 860 | 860 | * @return void |
| 861 | 861 | */ |
| 862 | - public static function event_list_css( $extra_class = '' ) { |
|
| 862 | + public static function event_list_css($extra_class = '') { |
|
| 863 | 863 | $EE = EE_Registry::instance(); |
| 864 | - $event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array(); |
|
| 864 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
| 865 | 865 | $event_list_css[] = 'espresso-event-list-event'; |
| 866 | - if ( self::$_type == 'grid' ) { |
|
| 867 | - $event_list_grid_size = isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium'; |
|
| 868 | - $event_list_css[] = $event_list_grid_size . '-event-list-grid'; |
|
| 866 | + if (self::$_type == 'grid') { |
|
| 867 | + $event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium'; |
|
| 868 | + $event_list_css[] = $event_list_grid_size.'-event-list-grid'; |
|
| 869 | 869 | } |
| 870 | - $event_list_css = apply_filters( 'EED_Events_Archive_Filters__event_list_css__event_list_css_array', $event_list_css ); |
|
| 871 | - return implode( ' ', $event_list_css ); |
|
| 870 | + $event_list_css = apply_filters('EED_Events_Archive_Filters__event_list_css__event_list_css_array', $event_list_css); |
|
| 871 | + return implode(' ', $event_list_css); |
|
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | |
@@ -894,9 +894,9 @@ discard block |
||
| 894 | 894 | * @access public |
| 895 | 895 | * @return void |
| 896 | 896 | */ |
| 897 | - public static function display_description( $value ) { |
|
| 897 | + public static function display_description($value) { |
|
| 898 | 898 | $EE = EE_Registry::instance(); |
| 899 | - $display_description= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1; |
|
| 899 | + $display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1; |
|
| 900 | 900 | return $display_description === $value ? TRUE : FALSE; |
| 901 | 901 | } |
| 902 | 902 | |
@@ -910,10 +910,10 @@ discard block |
||
| 910 | 910 | */ |
| 911 | 911 | public static function display_venue_details() { |
| 912 | 912 | $EE = EE_Registry::instance(); |
| 913 | - $EE->load_helper( 'Venue_View' ); |
|
| 914 | - $display_venue_details= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : TRUE; |
|
| 913 | + $EE->load_helper('Venue_View'); |
|
| 914 | + $display_venue_details = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : TRUE; |
|
| 915 | 915 | $venue_name = EEH_Venue_View::venue_name(); |
| 916 | - return $display_venue_details && ! empty( $venue_name ) ? TRUE : FALSE; |
|
| 916 | + return $display_venue_details && ! empty($venue_name) ? TRUE : FALSE; |
|
| 917 | 917 | } |
| 918 | 918 | |
| 919 | 919 | |
@@ -925,10 +925,10 @@ discard block |
||
| 925 | 925 | */ |
| 926 | 926 | public static function display_address() { |
| 927 | 927 | $EE = EE_Registry::instance(); |
| 928 | - $EE->load_helper( 'Venue_View' ); |
|
| 929 | - $display_address= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : FALSE; |
|
| 928 | + $EE->load_helper('Venue_View'); |
|
| 929 | + $display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : FALSE; |
|
| 930 | 930 | $venue_name = EEH_Venue_View::venue_name(); |
| 931 | - return $display_address && ! empty( $venue_name ) ? TRUE : FALSE; |
|
| 931 | + return $display_address && ! empty($venue_name) ? TRUE : FALSE; |
|
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | |
@@ -942,22 +942,22 @@ discard block |
||
| 942 | 942 | public static function pagination() { |
| 943 | 943 | global $wp_query; |
| 944 | 944 | $big = 999999999; // need an unlikely integer |
| 945 | - $pagination = paginate_links( array( |
|
| 946 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 945 | + $pagination = paginate_links(array( |
|
| 946 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
| 947 | 947 | 'format' => '?paged=%#%', |
| 948 | - 'current' => max( 1, get_query_var('paged') ), |
|
| 948 | + 'current' => max(1, get_query_var('paged')), |
|
| 949 | 949 | 'total' => $wp_query->max_num_pages, |
| 950 | 950 | 'show_all' => TRUE, |
| 951 | 951 | 'end_size' => 10, |
| 952 | 952 | 'mid_size' => 6, |
| 953 | 953 | 'prev_next' => TRUE, |
| 954 | - 'prev_text' => __( '‹ PREV', 'event_espresso' ), |
|
| 955 | - 'next_text' => __( 'NEXT ›', 'event_espresso' ), |
|
| 954 | + 'prev_text' => __('‹ PREV', 'event_espresso'), |
|
| 955 | + 'next_text' => __('NEXT ›', 'event_espresso'), |
|
| 956 | 956 | 'type' => 'plain', |
| 957 | 957 | 'add_args' => FALSE, |
| 958 | 958 | 'add_fragment' => '' |
| 959 | 959 | )); |
| 960 | - return ! empty( $pagination ) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : ''; |
|
| 960 | + return ! empty($pagination) ? '<div class="ee-pagination-dv clear">'.$pagination.'</div>' : ''; |
|
| 961 | 961 | } |
| 962 | 962 | |
| 963 | 963 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | * @return void |
| 972 | 972 | */ |
| 973 | 973 | public static function event_list_title() { |
| 974 | - return apply_filters( 'EED_Events_Archive_Filters__event_list_title__event_list_title', __( 'Upcoming Events', 'event_espresso' )); |
|
| 974 | + return apply_filters('EED_Events_Archive_Filters__event_list_title__event_list_title', __('Upcoming Events', 'event_espresso')); |
|
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 977 | |
@@ -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 | * |