@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,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 | /** |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | * @param string $shortcode |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - protected function _parser( $shortcode ) { |
|
64 | + protected function _parser($shortcode) { |
|
65 | 65 | |
66 | - if ( ! $this->_data instanceof EE_Datetime ) { |
|
66 | + if ( ! $this->_data instanceof EE_Datetime) { |
|
67 | 67 | return ''; //get out cause we can only parse with the datetime object. |
68 | 68 | } |
69 | 69 | |
70 | - switch ( $shortcode ) { |
|
70 | + switch ($shortcode) { |
|
71 | 71 | |
72 | 72 | case '[DATETIME_START]' : |
73 | 73 | return $this->_data->get_i18n_datetime('DTT_EVT_start'); |
@@ -81,27 +81,27 @@ discard block |
||
81 | 81 | return $this->_data->get_timezone(); |
82 | 82 | break; |
83 | 83 | case '[DATE_START]' : |
84 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) ); |
|
84 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format')); |
|
85 | 85 | break; |
86 | 86 | case '[DATE_END]' : |
87 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) ); |
|
87 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format')); |
|
88 | 88 | break; |
89 | 89 | case '[TIME_START]' : |
90 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) ); |
|
90 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format')); |
|
91 | 91 | break; |
92 | 92 | case '[TIME_END]' : |
93 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) ); |
|
93 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format')); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | |
97 | - if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE ) { |
|
98 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
97 | + if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) { |
|
98 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
99 | 99 | |
100 | - $link_text = empty( $attrs['link_text'] ) ? __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text']; |
|
100 | + $link_text = empty($attrs['link_text']) ? __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text']; |
|
101 | 101 | |
102 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() ); |
|
102 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url()); |
|
103 | 103 | |
104 | - return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>'; |
|
104 | + return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>'; |
|
105 | 105 | |
106 | 106 | } |
107 | 107 |
@@ -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 | * |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @return EED_Event_Single |
41 | 41 | */ |
42 | 42 | public static function instance() { |
43 | - return parent::get_instance( __CLASS__ ); |
|
43 | + return parent::get_instance(__CLASS__); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | * @return void |
53 | 53 | */ |
54 | 54 | public static function set_hooks() { |
55 | - add_filter( 'FHEE_run_EE_wp', '__return_true' ); |
|
56 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
57 | - EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' ); |
|
55 | + add_filter('FHEE_run_EE_wp', '__return_true'); |
|
56 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
57 | + EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @return void |
65 | 65 | */ |
66 | 66 | public static function set_hooks_admin() { |
67 | - add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 ); |
|
67 | + add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | * @return void |
79 | 79 | */ |
80 | 80 | public static function set_definitions() { |
81 | - define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
82 | - define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
81 | + define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
82 | + define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @void |
91 | 91 | */ |
92 | - protected function set_config(){ |
|
93 | - $this->set_config_section( 'template_settings' ); |
|
94 | - $this->set_config_class( 'EE_Event_Single_Config' ); |
|
95 | - $this->set_config_name( 'EED_Event_Single' ); |
|
92 | + protected function set_config() { |
|
93 | + $this->set_config_section('template_settings'); |
|
94 | + $this->set_config_class('EE_Event_Single_Config'); |
|
95 | + $this->set_config_name('EED_Event_Single'); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -105,35 +105,35 @@ discard block |
||
105 | 105 | * @param \EE_Event_Single_Config $config |
106 | 106 | * @return \EE_Template_Part_Manager |
107 | 107 | */ |
108 | - public function initialize_template_parts( EE_Event_Single_Config $config = null ) { |
|
108 | + public function initialize_template_parts(EE_Event_Single_Config $config = null) { |
|
109 | 109 | $config = $config instanceof EE_Event_Single_Config ? $config : $this->config(); |
110 | 110 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
111 | 111 | $template_parts = new EE_Template_Part_Manager(); |
112 | 112 | $template_parts->add_template_part( |
113 | 113 | 'tickets', |
114 | - __( 'Ticket Selector', 'event_espresso' ), |
|
114 | + __('Ticket Selector', 'event_espresso'), |
|
115 | 115 | 'content-espresso_events-tickets.php', |
116 | 116 | $config->display_order_tickets |
117 | 117 | ); |
118 | 118 | $template_parts->add_template_part( |
119 | 119 | 'datetimes', |
120 | - __( 'Dates and Times', 'event_espresso' ), |
|
120 | + __('Dates and Times', 'event_espresso'), |
|
121 | 121 | 'content-espresso_events-datetimes.php', |
122 | 122 | $config->display_order_datetimes |
123 | 123 | ); |
124 | 124 | $template_parts->add_template_part( |
125 | 125 | 'event', |
126 | - __( 'Event Description', 'event_espresso' ), |
|
126 | + __('Event Description', 'event_espresso'), |
|
127 | 127 | 'content-espresso_events-details.php', |
128 | 128 | $config->display_order_event |
129 | 129 | ); |
130 | 130 | $template_parts->add_template_part( |
131 | 131 | 'venue', |
132 | - __( 'Venue Information', 'event_espresso' ), |
|
132 | + __('Venue Information', 'event_espresso'), |
|
133 | 133 | 'content-espresso_events-venues.php', |
134 | 134 | $config->display_order_venue |
135 | 135 | ); |
136 | - do_action( 'AHEE__EED_Event_Single__initialize_template_parts', $template_parts ); |
|
136 | + do_action('AHEE__EED_Event_Single__initialize_template_parts', $template_parts); |
|
137 | 137 | return $template_parts; |
138 | 138 | } |
139 | 139 | |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | * @param WP $WP |
148 | 148 | * @return void |
149 | 149 | */ |
150 | - public function run( $WP ) { |
|
150 | + public function run($WP) { |
|
151 | 151 | // ensure valid EE_Events_Single_Config() object exists |
152 | 152 | $this->set_config(); |
153 | 153 | // check what template is loaded |
154 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
155 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
154 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
155 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
156 | 156 | // load css |
157 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
158 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
157 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
158 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | |
@@ -167,27 +167,27 @@ discard block |
||
167 | 167 | * @param string $template |
168 | 168 | * @return string |
169 | 169 | */ |
170 | - public function template_include( $template ) { |
|
170 | + public function template_include($template) { |
|
171 | 171 | global $post; |
172 | 172 | /** @type EE_Event_Single_Config $config */ |
173 | 173 | $config = $this->config(); |
174 | - if ( $config->display_status_banner_single ) { |
|
175 | - add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 ); |
|
174 | + if ($config->display_status_banner_single) { |
|
175 | + add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2); |
|
176 | 176 | } |
177 | 177 | // not a custom template? |
178 | 178 | if ( |
179 | 179 | EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' |
180 | - || apply_filters( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE ) |
|
181 | - && ! post_password_required( $post ) |
|
180 | + || apply_filters('FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE) |
|
181 | + && ! post_password_required($post) |
|
182 | 182 | ) { |
183 | 183 | EEH_Template::load_espresso_theme_functions(); |
184 | 184 | // then add extra event data via hooks |
185 | - add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' )); |
|
186 | - add_filter( 'get_the_excerpt', array( 'EED_Event_Single', 'get_the_excerpt' ), 1, 1 ); |
|
187 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
188 | - add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' )); |
|
185 | + add_action('loop_start', array('EED_Event_Single', 'loop_start')); |
|
186 | + add_filter('get_the_excerpt', array('EED_Event_Single', 'get_the_excerpt'), 1, 1); |
|
187 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
188 | + add_action('loop_end', array('EED_Event_Single', 'loop_end')); |
|
189 | 189 | // don't display entry meta because the existing theme will take car of that |
190 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
190 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
191 | 191 | } |
192 | 192 | return $template; |
193 | 193 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | * @param array $wp_query_array an array containing the WP_Query object |
202 | 202 | * @return void |
203 | 203 | */ |
204 | - public static function loop_start( $wp_query_array ) { |
|
204 | + public static function loop_start($wp_query_array) { |
|
205 | 205 | global $post; |
206 | - do_action( 'AHEE_event_details_before_post', $post, $wp_query_array ); |
|
206 | + do_action('AHEE_event_details_before_post', $post, $wp_query_array); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | * @param int $id |
217 | 217 | * @return string |
218 | 218 | */ |
219 | - public static function the_title( $title = '', $id = 0 ) { |
|
219 | + public static function the_title($title = '', $id = 0) { |
|
220 | 220 | global $post; |
221 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
221 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -230,9 +230,9 @@ discard block |
||
230 | 230 | * @param string $excerpt |
231 | 231 | * @return string |
232 | 232 | */ |
233 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
233 | + public static function get_the_excerpt($excerpt = '') { |
|
234 | 234 | EED_Event_Single::$using_get_the_excerpt = true; |
235 | - add_filter( 'wp_trim_excerpt', array( 'EED_Event_Single', 'end_get_the_excerpt' ), 999, 1 ); |
|
235 | + add_filter('wp_trim_excerpt', array('EED_Event_Single', 'end_get_the_excerpt'), 999, 1); |
|
236 | 236 | return $excerpt; |
237 | 237 | } |
238 | 238 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @param string $text |
246 | 246 | * @return string |
247 | 247 | */ |
248 | - public static function end_get_the_excerpt( $text = '' ) { |
|
248 | + public static function end_get_the_excerpt($text = '') { |
|
249 | 249 | EED_Event_Single::$using_get_the_excerpt = false; |
250 | 250 | return $text; |
251 | 251 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param string $content |
260 | 260 | * @return string |
261 | 261 | */ |
262 | - public static function event_details( $content ) { |
|
262 | + public static function event_details($content) { |
|
263 | 263 | global $post; |
264 | 264 | static $current_post_ID = 0; |
265 | 265 | if ( |
@@ -274,15 +274,15 @@ discard block |
||
274 | 274 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
275 | 275 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
276 | 276 | // so the following allows this filter to be applied multiple times, but only once for real |
277 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
278 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) { |
|
277 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
278 | + if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) { |
|
279 | 279 | // we need to first remove this callback from being applied to the_content() |
280 | 280 | // (otherwise it will recurse and blow up the interweb) |
281 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
281 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
282 | 282 | EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts(); |
283 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
284 | - $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content ); |
|
285 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
283 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
284 | + $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content); |
|
285 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
286 | 286 | } else { |
287 | 287 | $content = EED_Event_Single::use_filterable_display_order(); |
288 | 288 | } |
@@ -303,19 +303,19 @@ discard block |
||
303 | 303 | // it uses the_content() for displaying the $post->post_content |
304 | 304 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
305 | 305 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
306 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
306 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
307 | 307 | //now add additional content |
308 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 ); |
|
309 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 ); |
|
310 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 ); |
|
311 | - do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' ); |
|
308 | + add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1); |
|
309 | + add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1); |
|
310 | + add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1); |
|
311 | + do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters'); |
|
312 | 312 | // now load our template |
313 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
313 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
314 | 314 | //now add our filter back in, plus some others |
315 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
316 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 ); |
|
317 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 ); |
|
318 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 ); |
|
315 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
316 | + remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110); |
|
317 | + remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120); |
|
318 | + remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130); |
|
319 | 319 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
320 | 320 | return $content; |
321 | 321 | } |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | * @param string $content |
330 | 330 | * @return string |
331 | 331 | */ |
332 | - public static function event_datetimes( $content ) { |
|
333 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
332 | + public static function event_datetimes($content) { |
|
333 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | |
@@ -342,8 +342,8 @@ discard block |
||
342 | 342 | * @param string $content |
343 | 343 | * @return string |
344 | 344 | */ |
345 | - public static function event_tickets( $content ) { |
|
346 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
345 | + public static function event_tickets($content) { |
|
346 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | |
@@ -355,8 +355,8 @@ discard block |
||
355 | 355 | * @param string $content |
356 | 356 | * @return string |
357 | 357 | */ |
358 | - public static function event_venue( $content ) { |
|
359 | - return EED_Event_Single::event_venues( $content ); |
|
358 | + public static function event_venue($content) { |
|
359 | + return EED_Event_Single::event_venues($content); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | * @param string $content |
369 | 369 | * @return string |
370 | 370 | */ |
371 | - public static function event_venues( $content ) { |
|
372 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
371 | + public static function event_venues($content) { |
|
372 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | |
@@ -381,9 +381,9 @@ discard block |
||
381 | 381 | * @param array $wp_query_array an array containing the WP_Query object |
382 | 382 | * @return void |
383 | 383 | */ |
384 | - public static function loop_end( $wp_query_array ) { |
|
384 | + public static function loop_end($wp_query_array) { |
|
385 | 385 | global $post; |
386 | - do_action( 'AHEE_event_details_after_post', $post, $wp_query_array ); |
|
386 | + do_action('AHEE_event_details_after_post', $post, $wp_query_array); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | |
@@ -396,18 +396,18 @@ discard block |
||
396 | 396 | */ |
397 | 397 | public function wp_enqueue_scripts() { |
398 | 398 | // get some style |
399 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) { |
|
400 | - EE_Registry::instance()->load_helper( 'File' ); |
|
399 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) { |
|
400 | + EE_Registry::instance()->load_helper('File'); |
|
401 | 401 | // first check uploads folder |
402 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
403 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
402 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
403 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
404 | 404 | } else { |
405 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
405 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
406 | 406 | } |
407 | - wp_enqueue_script( $this->theme ); |
|
408 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
409 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
410 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
407 | + wp_enqueue_script($this->theme); |
|
408 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
409 | + EE_Registry::instance()->load_helper('Maps'); |
|
410 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 | } |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | * @return bool |
427 | 427 | */ |
428 | 428 | public static function display_venue() { |
429 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
429 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
430 | 430 | /** @type EE_Event_Single_Config $config */ |
431 | 431 | $config = EED_Event_Single::instance()->config(); |
432 | - $display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE; |
|
432 | + $display_venue = isset($config->display_venue) ? $config->display_venue : TRUE; |
|
433 | 433 | $venue_name = EEH_Venue_View::venue_name(); |
434 | - return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE; |
|
434 | + return $display_venue && ! empty($venue_name) ? TRUE : FALSE; |
|
435 | 435 | } |
436 | 436 | |
437 | 437 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @return EED_Ical |
33 | 33 | */ |
34 | 34 | public static function instance() { |
35 | - return parent::get_instance( __CLASS__ ); |
|
35 | + return parent::get_instance(__CLASS__); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public static function set_hooks() { |
47 | 47 | // create download buttons |
48 | - add_filter( 'FHEE__espresso_list_of_event_dates__datetime_html', array( 'EED_Ical', 'generate_add_to_iCal_button' ), 10, 2 ); |
|
48 | + add_filter('FHEE__espresso_list_of_event_dates__datetime_html', array('EED_Ical', 'generate_add_to_iCal_button'), 10, 2); |
|
49 | 49 | // process ics download request |
50 | - EE_Config::register_route( 'download_ics_file', 'EED_Ical', 'download_ics_file' ); |
|
50 | + EE_Config::register_route('download_ics_file', 'EED_Ical', 'download_ics_file'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param WP $WP |
71 | 71 | * @return void |
72 | 72 | */ |
73 | - public function run( $WP ) {} |
|
73 | + public function run($WP) {} |
|
74 | 74 | |
75 | 75 | |
76 | 76 | |
@@ -82,30 +82,30 @@ discard block |
||
82 | 82 | * @param $datetime |
83 | 83 | * @return string |
84 | 84 | */ |
85 | - public static function generate_add_to_iCal_button( $html, $datetime ) { |
|
85 | + public static function generate_add_to_iCal_button($html, $datetime) { |
|
86 | 86 | // first verify a proper datetime object has been received |
87 | - if ( $datetime instanceof EE_Datetime ) { |
|
87 | + if ($datetime instanceof EE_Datetime) { |
|
88 | 88 | // set whether a link or submit button is shown |
89 | - $iCal_type = apply_filters( 'FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit' ); |
|
89 | + $iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit'); |
|
90 | 90 | // generate a link to the route we registered in set_hooks() |
91 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $datetime->ID() ), site_url() ); |
|
91 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url()); |
|
92 | 92 | // what type ? |
93 | - switch ( $iCal_type ) { |
|
93 | + switch ($iCal_type) { |
|
94 | 94 | // submit buttons appear as buttons and are very compatible with a theme's style |
95 | 95 | case 'submit' : |
96 | - $html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >'; |
|
97 | - $html .= '<input type="submit" class="ee-ical-sbmt" value="" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '"/>'; |
|
96 | + $html .= '<form id="download-iCal-frm-'.$datetime->ID().'" class="download-iCal-frm" action="'.$URL.'" method="post" >'; |
|
97 | + $html .= '<input type="submit" class="ee-ical-sbmt" value="" title="'.__('Add to iCal Calendar', 'event_espresso').'"/>'; |
|
98 | 98 | $html .= '</form>'; |
99 | 99 | break; |
100 | 100 | // buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons |
101 | 101 | case 'button' : |
102 | - $html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">'; |
|
102 | + $html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">'; |
|
103 | 103 | $html .= ' <span class="dashicons dashicons-calendar"></span>'; |
104 | 104 | $html .= '</a>'; |
105 | 105 | break; |
106 | 106 | // links are just links that use the calendar dashicon |
107 | 107 | case 'icon' : |
108 | - $html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">'; |
|
108 | + $html .= '<a class="ee-ical-lnk" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">'; |
|
109 | 109 | $html .= ' <span class="dashicons dashicons-calendar"></span>'; |
110 | 110 | $html .= '</a>'; |
111 | 111 | break; |
@@ -123,73 +123,73 @@ discard block |
||
123 | 123 | * @return void |
124 | 124 | */ |
125 | 125 | public static function download_ics_file() { |
126 | - if ( EE_Registry::instance()->REQ->is_set( 'ics_id' )) { |
|
127 | - $DTT_ID = absint( EE_Registry::instance()->REQ->get( 'ics_id' )); |
|
128 | - $datetime = EE_Registry::instance()->load_model( 'Datetime' )->get_one_by_ID( $DTT_ID ); |
|
129 | - if ( $datetime instanceof EE_Datetime ) { |
|
126 | + if (EE_Registry::instance()->REQ->is_set('ics_id')) { |
|
127 | + $DTT_ID = absint(EE_Registry::instance()->REQ->get('ics_id')); |
|
128 | + $datetime = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($DTT_ID); |
|
129 | + if ($datetime instanceof EE_Datetime) { |
|
130 | 130 | // get related event, venues, and event categories |
131 | 131 | $event = $datetime->event(); |
132 | 132 | // get related category Term object and it's name |
133 | 133 | $category = $event->first_event_category(); |
134 | - if ( $category instanceof EE_Term ) { |
|
134 | + if ($category instanceof EE_Term) { |
|
135 | 135 | $category = $category->name(); |
136 | 136 | } |
137 | 137 | $location = ''; |
138 | 138 | // get first related venue and convert to CSV string |
139 | - $venue = $event->venues(array( 'limit'=>1 )); |
|
140 | - if ( is_array( $venue ) && ! empty( $venue )) { |
|
141 | - $venue = array_shift( $venue ); |
|
142 | - if ( $venue instanceof EE_Venue ) { |
|
143 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
144 | - $location = espresso_venue_raw_address( 'inline', $venue->ID(), FALSE ); |
|
139 | + $venue = $event->venues(array('limit'=>1)); |
|
140 | + if (is_array($venue) && ! empty($venue)) { |
|
141 | + $venue = array_shift($venue); |
|
142 | + if ($venue instanceof EE_Venue) { |
|
143 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
144 | + $location = espresso_venue_raw_address('inline', $venue->ID(), FALSE); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | // set variables, escape strings, convert timestamps to ics format, etc |
148 | - $filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics'; |
|
149 | - $organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name ); |
|
150 | - $UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() )); |
|
151 | - $org_email = EED_Ical::_escape_ICal_data( $datetime->ID() ); |
|
152 | - $timestamp = date( EED_Ical::iCal_datetime_format ); |
|
153 | - $location = EED_Ical::_escape_ICal_data( $location ); |
|
154 | - $summary = EED_Ical::_escape_ICal_data( $event->name() ); |
|
155 | - $description = EED_Ical::_escape_ICal_description( wp_strip_all_tags( $event->description() )); |
|
148 | + $filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics'; |
|
149 | + $organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name); |
|
150 | + $UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID())); |
|
151 | + $org_email = EED_Ical::_escape_ICal_data($datetime->ID()); |
|
152 | + $timestamp = date(EED_Ical::iCal_datetime_format); |
|
153 | + $location = EED_Ical::_escape_ICal_data($location); |
|
154 | + $summary = EED_Ical::_escape_ICal_data($event->name()); |
|
155 | + $description = EED_Ical::_escape_ICal_description(wp_strip_all_tags($event->description())); |
|
156 | 156 | $status = $datetime->get_active_status(); |
157 | 157 | $status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed'; |
158 | - $status = EED_Ical::_escape_ICal_data( $status ); |
|
159 | - $categories = EED_Ical::_escape_ICal_data( $category ); |
|
160 | - $url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() )); |
|
161 | - $dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() )); |
|
162 | - $dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() )); |
|
158 | + $status = EED_Ical::_escape_ICal_data($status); |
|
159 | + $categories = EED_Ical::_escape_ICal_data($category); |
|
160 | + $url = EED_Ical::_escape_ICal_data(get_permalink($event->ID())); |
|
161 | + $dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start())); |
|
162 | + $dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end())); |
|
163 | 163 | // set headers |
164 | - header( 'Content-type: text/calendar; charset=utf-8' ); |
|
165 | - header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); |
|
166 | - header( 'Cache-Control: private, max-age=0, must-revalidate' ); |
|
167 | - header( 'Pragma: public' ); |
|
168 | - header( 'Content-Type: application/octet-stream' ); |
|
169 | - header( 'Content-Type: application/force-download' ); |
|
170 | - header( 'Cache-Control: no-cache, must-revalidate' ); |
|
171 | - header( 'Content-Transfer-Encoding: binary' ); |
|
172 | - header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date |
|
173 | - ini_set( 'zlib.output_compression', '0' ); |
|
164 | + header('Content-type: text/calendar; charset=utf-8'); |
|
165 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
166 | + header('Cache-Control: private, max-age=0, must-revalidate'); |
|
167 | + header('Pragma: public'); |
|
168 | + header('Content-Type: application/octet-stream'); |
|
169 | + header('Content-Type: application/force-download'); |
|
170 | + header('Cache-Control: no-cache, must-revalidate'); |
|
171 | + header('Content-Transfer-Encoding: binary'); |
|
172 | + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date |
|
173 | + ini_set('zlib.output_compression', '0'); |
|
174 | 174 | // echo the output |
175 | - echo "BEGIN:VCALENDAR" . PHP_EOL; |
|
176 | - echo "VERSION:2.0" . PHP_EOL; |
|
177 | - echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL; |
|
178 | - echo "CALSCALE:GREGORIAN" . PHP_EOL; |
|
179 | - echo "BEGIN:VEVENT" . PHP_EOL; |
|
180 | - echo "UID:{$UID}" . PHP_EOL; |
|
181 | - echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL; |
|
182 | - echo "DTSTAMP:{$timestamp}" . PHP_EOL; |
|
183 | - echo "LOCATION:{$location}" . PHP_EOL; |
|
184 | - echo "SUMMARY:{$summary}" . PHP_EOL; |
|
185 | - echo "DESCRIPTION:{$description}" . PHP_EOL; |
|
186 | - echo "STATUS:{$status}" . PHP_EOL; |
|
187 | - echo "CATEGORIES:{$categories}" . PHP_EOL; |
|
188 | - echo "URL;VALUE=URI:{$url}" . PHP_EOL; |
|
189 | - echo "DTSTART:{$dtt_start}" . PHP_EOL; |
|
190 | - echo "DTEND:{$dtt_end}" . PHP_EOL; |
|
191 | - echo "END:VEVENT" . PHP_EOL; |
|
192 | - echo "END:VCALENDAR" . PHP_EOL; |
|
175 | + echo "BEGIN:VCALENDAR".PHP_EOL; |
|
176 | + echo "VERSION:2.0".PHP_EOL; |
|
177 | + echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL; |
|
178 | + echo "CALSCALE:GREGORIAN".PHP_EOL; |
|
179 | + echo "BEGIN:VEVENT".PHP_EOL; |
|
180 | + echo "UID:{$UID}".PHP_EOL; |
|
181 | + echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL; |
|
182 | + echo "DTSTAMP:{$timestamp}".PHP_EOL; |
|
183 | + echo "LOCATION:{$location}".PHP_EOL; |
|
184 | + echo "SUMMARY:{$summary}".PHP_EOL; |
|
185 | + echo "DESCRIPTION:{$description}".PHP_EOL; |
|
186 | + echo "STATUS:{$status}".PHP_EOL; |
|
187 | + echo "CATEGORIES:{$categories}".PHP_EOL; |
|
188 | + echo "URL;VALUE=URI:{$url}".PHP_EOL; |
|
189 | + echo "DTSTART:{$dtt_start}".PHP_EOL; |
|
190 | + echo "DTEND:{$dtt_end}".PHP_EOL; |
|
191 | + echo "END:VEVENT".PHP_EOL; |
|
192 | + echo "END:VCALENDAR".PHP_EOL; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | die(); |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | * @param string $string |
205 | 205 | * @return string |
206 | 206 | */ |
207 | - private static function _escape_ICal_data( $string = '' ) { |
|
208 | - return preg_replace( '/([\,;])/', '\\\$1', $string ); |
|
207 | + private static function _escape_ICal_data($string = '') { |
|
208 | + return preg_replace('/([\,;])/', '\\\$1', $string); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -215,13 +215,13 @@ discard block |
||
215 | 215 | * @param string $description |
216 | 216 | * @return string |
217 | 217 | */ |
218 | - private static function _escape_ICal_description( $description = '' ) { |
|
218 | + private static function _escape_ICal_description($description = '') { |
|
219 | 219 | |
220 | 220 | //Escape spcial chars within the decription |
221 | - $description = EED_Ical::_escape_ICal_data( $description ); |
|
221 | + $description = EED_Ical::_escape_ICal_data($description); |
|
222 | 222 | |
223 | 223 | //Remove line breaks and output in iCal format |
224 | - $description = str_replace( array( "\r\n", "\n"), '\n', $description ); |
|
224 | + $description = str_replace(array("\r\n", "\n"), '\n', $description); |
|
225 | 225 | |
226 | 226 | return $description; |
227 | 227 | } |
@@ -220,8 +220,8 @@ |
||
220 | 220 | //Escape spcial chars within the decription |
221 | 221 | $description = EED_Ical::_escape_ICal_data( $description ); |
222 | 222 | |
223 | - //Remove line breaks and output in iCal format |
|
224 | - $description = str_replace( array( "\r\n", "\n"), '\n', $description ); |
|
223 | + //Remove line breaks and output in iCal format |
|
224 | + $description = str_replace( array( "\r\n", "\n"), '\n', $description ); |
|
225 | 225 | |
226 | 226 | return $description; |
227 | 227 | } |
@@ -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 | * |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * process_registration_from_admin |
281 | 281 | * |
282 | 282 | * @access public |
283 | - * @return int |
|
283 | + * @return EE_Transaction |
|
284 | 284 | */ |
285 | 285 | public static function process_registration_from_admin() { |
286 | 286 | EED_Single_Page_Checkout::load_reg_steps(); |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | * _get_transaction_and_cart_for_previous_visit |
609 | 609 | * |
610 | 610 | * @access private |
611 | - * @return mixed EE_Transaction|NULL |
|
611 | + * @return EE_Transaction|null EE_Transaction|NULL |
|
612 | 612 | */ |
613 | 613 | private function _get_transaction_and_cart_for_previous_visit() { |
614 | 614 | /** @var $TXN_model EEM_Transaction */ |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | * generates a new EE_Transaction object and adds it to the $_transaction property. |
678 | 678 | * |
679 | 679 | * @access private |
680 | - * @return mixed EE_Transaction|NULL |
|
680 | + * @return EE_Transaction|null EE_Transaction|NULL |
|
681 | 681 | */ |
682 | 682 | private function _initialize_transaction() { |
683 | 683 | try { |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | * @return EED_Single_Page_Checkout |
39 | 39 | */ |
40 | 40 | public static function instance() { |
41 | - add_filter( 'EED_Single_Page_Checkout__SPCO_active', '__return_true' ); |
|
42 | - return parent::get_instance( __CLASS__ ); |
|
41 | + add_filter('EED_Single_Page_Checkout__SPCO_active', '__return_true'); |
|
42 | + return parent::get_instance(__CLASS__); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -84,22 +84,22 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public static function set_hooks_admin() { |
86 | 86 | EED_Single_Page_Checkout::set_definitions(); |
87 | - if ( defined( 'DOING_AJAX' )) { |
|
87 | + if (defined('DOING_AJAX')) { |
|
88 | 88 | // going to start an output buffer in case anything gets accidentally output that might disrupt our JSON response |
89 | 89 | ob_start(); |
90 | 90 | EED_Single_Page_Checkout::load_request_handler(); |
91 | 91 | EED_Single_Page_Checkout::load_reg_steps(); |
92 | 92 | } else { |
93 | 93 | // hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called |
94 | - add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 ); |
|
94 | + add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1); |
|
95 | 95 | } |
96 | 96 | // set ajax hooks |
97 | - add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' )); |
|
98 | - add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' )); |
|
99 | - add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' )); |
|
100 | - add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' )); |
|
101 | - add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' )); |
|
102 | - add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' )); |
|
97 | + add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step')); |
|
98 | + add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step')); |
|
99 | + add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step')); |
|
100 | + add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step')); |
|
101 | + add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step')); |
|
102 | + add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step')); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | * process ajax request |
109 | 109 | * @param string $ajax_action |
110 | 110 | */ |
111 | - public static function process_ajax_request( $ajax_action ) { |
|
112 | - EE_Registry::instance()->REQ->set( 'action', $ajax_action ); |
|
111 | + public static function process_ajax_request($ajax_action) { |
|
112 | + EE_Registry::instance()->REQ->set('action', $ajax_action); |
|
113 | 113 | EED_Single_Page_Checkout::instance()->_initialize(); |
114 | 114 | } |
115 | 115 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * ajax display registration step |
120 | 120 | */ |
121 | 121 | public static function display_reg_step() { |
122 | - EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' ); |
|
122 | + EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * ajax process registration step |
129 | 129 | */ |
130 | 130 | public static function process_reg_step() { |
131 | - EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' ); |
|
131 | + EED_Single_Page_Checkout::process_ajax_request('process_reg_step'); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * ajax process registration step |
138 | 138 | */ |
139 | 139 | public static function update_reg_step() { |
140 | - EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' ); |
|
140 | + EED_Single_Page_Checkout::process_ajax_request('update_reg_step'); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @return void |
150 | 150 | */ |
151 | 151 | public static function update_checkout() { |
152 | - EED_Single_Page_Checkout::process_ajax_request( 'update_checkout' ); |
|
152 | + EED_Single_Page_Checkout::process_ajax_request('update_checkout'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public static function load_request_handler() { |
164 | 164 | // load core Request_Handler class |
165 | - if ( ! isset( EE_Registry::instance()->REQ )) { |
|
166 | - EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
165 | + if ( ! isset(EE_Registry::instance()->REQ)) { |
|
166 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
@@ -176,14 +176,14 @@ discard block |
||
176 | 176 | * @return void |
177 | 177 | */ |
178 | 178 | public static function set_definitions() { |
179 | - define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS ); |
|
180 | - define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS ); |
|
181 | - define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS ); |
|
182 | - define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS ); |
|
183 | - define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS ); |
|
184 | - define( 'SPCO_REG_STEPS_PATH', SPCO_BASE_PATH . 'reg_steps' . DS ); |
|
185 | - define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS ); |
|
186 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE ); |
|
179 | + define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS); |
|
180 | + define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS); |
|
181 | + define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS); |
|
182 | + define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS); |
|
183 | + define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS); |
|
184 | + define('SPCO_REG_STEPS_PATH', SPCO_BASE_PATH.'reg_steps'.DS); |
|
185 | + define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS); |
|
186 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public static function load_reg_steps() { |
200 | 200 | static $reg_steps_loaded = FALSE; |
201 | - if ( $reg_steps_loaded ) { |
|
201 | + if ($reg_steps_loaded) { |
|
202 | 202 | return; |
203 | 203 | } |
204 | 204 | // filter list of reg_steps |
@@ -207,24 +207,24 @@ discard block |
||
207 | 207 | EED_Single_Page_Checkout::get_reg_steps() |
208 | 208 | ); |
209 | 209 | // sort by key (order) |
210 | - ksort( $reg_steps_to_load ); |
|
210 | + ksort($reg_steps_to_load); |
|
211 | 211 | // loop through folders |
212 | - foreach ( $reg_steps_to_load as $order => $reg_step ) { |
|
212 | + foreach ($reg_steps_to_load as $order => $reg_step) { |
|
213 | 213 | // we need a |
214 | - if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) { |
|
214 | + if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) { |
|
215 | 215 | // copy over to the reg_steps_array |
216 | - EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step; |
|
216 | + EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step; |
|
217 | 217 | // register custom key route for each reg step |
218 | 218 | // ie: step=>"slug" - this is the entire reason we load the reg steps array now |
219 | - EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' ); |
|
219 | + EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step'); |
|
220 | 220 | // add AJAX or other hooks |
221 | - if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) { |
|
221 | + if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) { |
|
222 | 222 | // setup autoloaders if necessary |
223 | - if ( ! class_exists( $reg_step['class_name'] )) { |
|
224 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE ); |
|
223 | + if ( ! class_exists($reg_step['class_name'])) { |
|
224 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE); |
|
225 | 225 | } |
226 | - if ( is_callable( $reg_step['class_name'], 'set_hooks' )) { |
|
227 | - call_user_func( array( $reg_step['class_name'], 'set_hooks' )); |
|
226 | + if (is_callable($reg_step['class_name'], 'set_hooks')) { |
|
227 | + call_user_func(array($reg_step['class_name'], 'set_hooks')); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | } |
@@ -243,28 +243,28 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public static function get_reg_steps() { |
245 | 245 | $reg_steps = EE_Registry::instance()->CFG->registration->reg_steps; |
246 | - if ( empty( $reg_steps )) { |
|
246 | + if (empty($reg_steps)) { |
|
247 | 247 | $reg_steps = array( |
248 | 248 | 10 => array( |
249 | - 'file_path' => SPCO_REG_STEPS_PATH . 'attendee_information', |
|
249 | + 'file_path' => SPCO_REG_STEPS_PATH.'attendee_information', |
|
250 | 250 | 'class_name' => 'EE_SPCO_Reg_Step_Attendee_Information', |
251 | 251 | 'slug' => 'attendee_information', |
252 | 252 | 'has_hooks' => FALSE |
253 | 253 | ), |
254 | 254 | 20 => array( |
255 | - 'file_path' => SPCO_REG_STEPS_PATH . 'registration_confirmation', |
|
255 | + 'file_path' => SPCO_REG_STEPS_PATH.'registration_confirmation', |
|
256 | 256 | 'class_name' => 'EE_SPCO_Reg_Step_Registration_Confirmation', |
257 | 257 | 'slug' => 'registration_confirmation', |
258 | 258 | 'has_hooks' => FALSE |
259 | 259 | ), |
260 | 260 | 30 => array( |
261 | - 'file_path' => SPCO_REG_STEPS_PATH . 'payment_options', |
|
261 | + 'file_path' => SPCO_REG_STEPS_PATH.'payment_options', |
|
262 | 262 | 'class_name' => 'EE_SPCO_Reg_Step_Payment_Options', |
263 | 263 | 'slug' => 'payment_options', |
264 | 264 | 'has_hooks' => TRUE |
265 | 265 | ), |
266 | 266 | 999 => array( |
267 | - 'file_path' => SPCO_REG_STEPS_PATH . 'finalize_registration', |
|
267 | + 'file_path' => SPCO_REG_STEPS_PATH.'finalize_registration', |
|
268 | 268 | 'class_name' => 'EE_SPCO_Reg_Step_Finalize_Registration', |
269 | 269 | 'slug' => 'finalize_registration', |
270 | 270 | 'has_hooks' => FALSE |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public static function registration_checkout_for_admin() { |
286 | 286 | EED_Single_Page_Checkout::load_reg_steps(); |
287 | - EE_Registry::instance()->REQ->set( 'step', 'attendee_information' ); |
|
288 | - EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' ); |
|
289 | - EE_Registry::instance()->REQ->set( 'process_form_submission', false ); |
|
287 | + EE_Registry::instance()->REQ->set('step', 'attendee_information'); |
|
288 | + EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step'); |
|
289 | + EE_Registry::instance()->REQ->set('process_form_submission', false); |
|
290 | 290 | EED_Single_Page_Checkout::instance()->_initialize(); |
291 | 291 | EED_Single_Page_Checkout::instance()->_display_spco_reg_form(); |
292 | 292 | return EE_Registry::instance()->REQ->get_output(); |
@@ -302,15 +302,15 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public static function process_registration_from_admin() { |
304 | 304 | EED_Single_Page_Checkout::load_reg_steps(); |
305 | - EE_Registry::instance()->REQ->set( 'step', 'attendee_information' ); |
|
306 | - EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' ); |
|
307 | - EE_Registry::instance()->REQ->set( 'process_form_submission', true ); |
|
305 | + EE_Registry::instance()->REQ->set('step', 'attendee_information'); |
|
306 | + EE_Registry::instance()->REQ->set('action', 'process_reg_step'); |
|
307 | + EE_Registry::instance()->REQ->set('process_form_submission', true); |
|
308 | 308 | EED_Single_Page_Checkout::instance()->_initialize(); |
309 | - if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) { |
|
310 | - $final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps ); |
|
311 | - if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) { |
|
312 | - EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated( $final_reg_step ); |
|
313 | - if ( $final_reg_step->process_reg_step() ) { |
|
309 | + if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) { |
|
310 | + $final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps); |
|
311 | + if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) { |
|
312 | + EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated($final_reg_step); |
|
313 | + if ($final_reg_step->process_reg_step()) { |
|
314 | 314 | $final_reg_step->set_completed(); |
315 | 315 | EED_Single_Page_Checkout::instance()->checkout->update_txn_reg_steps_array(); |
316 | 316 | return EED_Single_Page_Checkout::instance()->checkout->transaction; |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | * @param WP_Query $WP_Query |
330 | 330 | * @return void |
331 | 331 | */ |
332 | - public function run( $WP_Query ) { |
|
332 | + public function run($WP_Query) { |
|
333 | 333 | if ( |
334 | 334 | $WP_Query instanceof WP_Query |
335 | 335 | && $WP_Query->is_main_query() |
336 | - && apply_filters( 'FHEE__EED_Single_Page_Checkout__run', true ) |
|
336 | + && apply_filters('FHEE__EED_Single_Page_Checkout__run', true) |
|
337 | 337 | ) { |
338 | 338 | $this->_initialize(); |
339 | 339 | } |
@@ -349,8 +349,8 @@ discard block |
||
349 | 349 | * @param WP_Query $WP_Query |
350 | 350 | * @return void |
351 | 351 | */ |
352 | - public static function init( $WP_Query ) { |
|
353 | - EED_Single_Page_Checkout::instance()->run( $WP_Query ); |
|
352 | + public static function init($WP_Query) { |
|
353 | + EED_Single_Page_Checkout::instance()->run($WP_Query); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | |
@@ -364,35 +364,35 @@ discard block |
||
364 | 364 | */ |
365 | 365 | private function _initialize() { |
366 | 366 | // ensure SPCO doesn't run twice |
367 | - if ( EED_Single_Page_Checkout::$_initialized ) { |
|
367 | + if (EED_Single_Page_Checkout::$_initialized) { |
|
368 | 368 | return; |
369 | 369 | } |
370 | 370 | // setup the EE_Checkout object |
371 | 371 | $this->checkout = $this->_initialize_checkout(); |
372 | 372 | // filter checkout |
373 | - $this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout ); |
|
373 | + $this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout); |
|
374 | 374 | // get the $_GET |
375 | 375 | $this->_get_request_vars(); |
376 | 376 | // filter continue_reg |
377 | - $this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout ); |
|
377 | + $this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout); |
|
378 | 378 | // load the reg steps array |
379 | - if ( ! $this->_load_and_instantiate_reg_steps() ) { |
|
379 | + if ( ! $this->_load_and_instantiate_reg_steps()) { |
|
380 | 380 | EED_Single_Page_Checkout::$_initialized = true; |
381 | 381 | return; |
382 | 382 | } |
383 | 383 | // set the current step |
384 | - $this->checkout->set_current_step( $this->checkout->step ); |
|
384 | + $this->checkout->set_current_step($this->checkout->step); |
|
385 | 385 | // and the next step |
386 | 386 | $this->checkout->set_next_step(); |
387 | 387 | // was there already a valid transaction in the checkout from the session ? |
388 | - if ( ! $this->checkout->transaction instanceof EE_Transaction ) { |
|
388 | + if ( ! $this->checkout->transaction instanceof EE_Transaction) { |
|
389 | 389 | // get transaction from db or session |
390 | 390 | $this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin() |
391 | 391 | ? $this->_get_transaction_and_cart_for_previous_visit() |
392 | 392 | : $this->_get_cart_for_current_session_and_setup_new_transaction(); |
393 | - if ( ! $this->checkout->transaction instanceof EE_Transaction ) { |
|
393 | + if ( ! $this->checkout->transaction instanceof EE_Transaction) { |
|
394 | 394 | EE_Error::add_error( |
395 | - __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), |
|
395 | + __('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), |
|
396 | 396 | __FILE__, __FUNCTION__, __LINE__ |
397 | 397 | ); |
398 | 398 | // add some style and make it dance |
@@ -402,10 +402,10 @@ discard block |
||
402 | 402 | return; |
403 | 403 | } |
404 | 404 | // and the registrations for the transaction |
405 | - $this->_get_registrations( $this->checkout->transaction ); |
|
405 | + $this->_get_registrations($this->checkout->transaction); |
|
406 | 406 | } |
407 | 407 | // verify that everything has been setup correctly |
408 | - if ( ! $this->_final_verifications() ) { |
|
408 | + if ( ! $this->_final_verifications()) { |
|
409 | 409 | EED_Single_Page_Checkout::$_initialized = true; |
410 | 410 | return; |
411 | 411 | } |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | // set no cache headers and constants |
431 | 431 | EE_System::do_not_cache(); |
432 | 432 | // add anchor |
433 | - add_action( 'loop_start', array( $this, 'set_checkout_anchor' ), 1 ); |
|
433 | + add_action('loop_start', array($this, 'set_checkout_anchor'), 1); |
|
434 | 434 | // remove transaction lock |
435 | - add_action( 'shutdown', array( $this, 'unlock_transaction' ), 1 ); |
|
435 | + add_action('shutdown', array($this, 'unlock_transaction'), 1); |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | |
@@ -449,20 +449,20 @@ discard block |
||
449 | 449 | // look in session for existing checkout |
450 | 450 | $checkout = EE_Registry::instance()->SSN->checkout(); |
451 | 451 | // verify |
452 | - if ( ! $checkout instanceof EE_Checkout ) { |
|
452 | + if ( ! $checkout instanceof EE_Checkout) { |
|
453 | 453 | // instantiate EE_Checkout object for handling the properties of the current checkout process |
454 | - $checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE ); |
|
454 | + $checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE); |
|
455 | 455 | // verify again |
456 | - if ( ! $checkout instanceof EE_Checkout ) { |
|
457 | - throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) ); |
|
456 | + if ( ! $checkout instanceof EE_Checkout) { |
|
457 | + throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso')); |
|
458 | 458 | } |
459 | 459 | } else { |
460 | - if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true ) { |
|
461 | - wp_safe_redirect( $checkout->redirect_url ); |
|
460 | + if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) { |
|
461 | + wp_safe_redirect($checkout->redirect_url); |
|
462 | 462 | exit(); |
463 | 463 | } |
464 | 464 | } |
465 | - $checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout ); |
|
465 | + $checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout); |
|
466 | 466 | // reset anything that needs a clean slate for each request |
467 | 467 | $checkout->reset_for_current_request(); |
468 | 468 | return $checkout; |
@@ -480,24 +480,24 @@ discard block |
||
480 | 480 | // load classes |
481 | 481 | EED_Single_Page_Checkout::load_request_handler(); |
482 | 482 | //make sure this request is marked as belonging to EE |
483 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
483 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
484 | 484 | // which step is being requested ? |
485 | - $this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() ); |
|
485 | + $this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step()); |
|
486 | 486 | // which step is being edited ? |
487 | - $this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' ); |
|
487 | + $this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', ''); |
|
488 | 488 | // and what we're doing on the current step |
489 | - $this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ); |
|
489 | + $this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step'); |
|
490 | 490 | // returning to edit ? |
491 | - $this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' ); |
|
491 | + $this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', ''); |
|
492 | 492 | // or some other kind of revisit ? |
493 | - $this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE ); |
|
493 | + $this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE); |
|
494 | 494 | // and whether or not to generate a reg form for this request |
495 | - $this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); // TRUE FALSE |
|
495 | + $this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE FALSE |
|
496 | 496 | // and whether or not to process a reg form submission for this request |
497 | - $this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); // TRUE FALSE |
|
497 | + $this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE FALSE |
|
498 | 498 | $this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' |
499 | 499 | ? $this->checkout->process_form_submission |
500 | - : FALSE; // TRUE FALSE |
|
500 | + : FALSE; // TRUE FALSE |
|
501 | 501 | //$this->_display_request_vars(); |
502 | 502 | } |
503 | 503 | |
@@ -510,17 +510,17 @@ discard block |
||
510 | 510 | * @return void |
511 | 511 | */ |
512 | 512 | protected function _display_request_vars() { |
513 | - if ( ! WP_DEBUG ) { |
|
513 | + if ( ! WP_DEBUG) { |
|
514 | 514 | return; |
515 | 515 | } |
516 | - EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ ); |
|
517 | - EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ ); |
|
518 | - EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ ); |
|
519 | - EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ ); |
|
520 | - EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ ); |
|
521 | - EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ ); |
|
522 | - EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ ); |
|
523 | - EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ ); |
|
516 | + EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__); |
|
517 | + EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__); |
|
518 | + EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__); |
|
519 | + EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__); |
|
520 | + EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__); |
|
521 | + EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__); |
|
522 | + EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__); |
|
523 | + EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | |
@@ -534,8 +534,8 @@ discard block |
||
534 | 534 | * @return array |
535 | 535 | */ |
536 | 536 | private function _get_first_step() { |
537 | - $first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array ); |
|
538 | - return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information'; |
|
537 | + $first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array); |
|
538 | + return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information'; |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | |
@@ -551,27 +551,27 @@ discard block |
||
551 | 551 | private function _load_and_instantiate_reg_steps() { |
552 | 552 | // have reg_steps already been instantiated ? |
553 | 553 | if ( |
554 | - empty( $this->checkout->reg_steps ) || |
|
555 | - apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout ) |
|
554 | + empty($this->checkout->reg_steps) || |
|
555 | + apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout) |
|
556 | 556 | ) { |
557 | 557 | // if not, then loop through raw reg steps array |
558 | - foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) { |
|
559 | - if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) { |
|
558 | + foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) { |
|
559 | + if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) { |
|
560 | 560 | return false; |
561 | 561 | } |
562 | 562 | } |
563 | 563 | EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE; |
564 | 564 | EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE; |
565 | 565 | // skip the registration_confirmation page ? |
566 | - if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) { |
|
566 | + if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) { |
|
567 | 567 | // just remove it from the reg steps array |
568 | - $this->checkout->remove_reg_step( 'registration_confirmation', false ); |
|
568 | + $this->checkout->remove_reg_step('registration_confirmation', false); |
|
569 | 569 | } else if ( |
570 | 570 | EE_Registry::instance()->CFG->registration->reg_confirmation_last |
571 | - && isset( $this->checkout->reg_steps['registration_confirmation'] ) |
|
571 | + && isset($this->checkout->reg_steps['registration_confirmation']) |
|
572 | 572 | ) { |
573 | 573 | // set the order to something big like 100 |
574 | - $this->checkout->set_reg_step_order( 'registration_confirmation', 100 ); |
|
574 | + $this->checkout->set_reg_step_order('registration_confirmation', 100); |
|
575 | 575 | } |
576 | 576 | // filter the array for good luck |
577 | 577 | $this->checkout->reg_steps = apply_filters( |
@@ -581,13 +581,13 @@ discard block |
||
581 | 581 | // finally re-sort based on the reg step class order properties |
582 | 582 | $this->checkout->sort_reg_steps(); |
583 | 583 | } else { |
584 | - foreach ( $this->checkout->reg_steps as $reg_step ) { |
|
584 | + foreach ($this->checkout->reg_steps as $reg_step) { |
|
585 | 585 | // set all current step stati to FALSE |
586 | - $reg_step->set_is_current_step( FALSE ); |
|
586 | + $reg_step->set_is_current_step(FALSE); |
|
587 | 587 | } |
588 | 588 | } |
589 | - if ( empty( $this->checkout->reg_steps )) { |
|
590 | - EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
589 | + if (empty($this->checkout->reg_steps)) { |
|
590 | + EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
591 | 591 | return false; |
592 | 592 | } |
593 | 593 | // make reg step details available to JS |
@@ -605,10 +605,10 @@ discard block |
||
605 | 605 | * @param int $order |
606 | 606 | * @return bool |
607 | 607 | */ |
608 | - private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) { |
|
608 | + private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) { |
|
609 | 609 | |
610 | 610 | // we need a file_path, class_name, and slug to add a reg step |
611 | - if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) { |
|
611 | + if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) { |
|
612 | 612 | // if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step) |
613 | 613 | if ( |
614 | 614 | $this->checkout->reg_url_link |
@@ -626,26 +626,26 @@ discard block |
||
626 | 626 | FALSE |
627 | 627 | ); |
628 | 628 | // did we gets the goods ? |
629 | - if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) { |
|
629 | + if ($reg_step_obj instanceof EE_SPCO_Reg_Step) { |
|
630 | 630 | // set reg step order based on config |
631 | - $reg_step_obj->set_order( $order ); |
|
631 | + $reg_step_obj->set_order($order); |
|
632 | 632 | // add instantiated reg step object to the master reg steps array |
633 | - $this->checkout->add_reg_step( $reg_step_obj ); |
|
633 | + $this->checkout->add_reg_step($reg_step_obj); |
|
634 | 634 | } else { |
635 | 635 | EE_Error::add_error( |
636 | - __( 'The current step could not be set.', 'event_espresso' ), |
|
636 | + __('The current step could not be set.', 'event_espresso'), |
|
637 | 637 | __FILE__, __FUNCTION__, __LINE__ |
638 | 638 | ); |
639 | 639 | return false; |
640 | 640 | } |
641 | 641 | } else { |
642 | - if ( WP_DEBUG ) { |
|
642 | + if (WP_DEBUG) { |
|
643 | 643 | EE_Error::add_error( |
644 | 644 | sprintf( |
645 | - __( 'A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso' ), |
|
646 | - isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '', |
|
647 | - isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '', |
|
648 | - isset( $reg_step['slug'] ) ? $reg_step['slug'] : '', |
|
645 | + __('A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso'), |
|
646 | + isset($reg_step['file_path']) ? $reg_step['file_path'] : '', |
|
647 | + isset($reg_step['class_name']) ? $reg_step['class_name'] : '', |
|
648 | + isset($reg_step['slug']) ? $reg_step['slug'] : '', |
|
649 | 649 | '<ul>', |
650 | 650 | '<li>', |
651 | 651 | '</li>', |
@@ -669,16 +669,16 @@ discard block |
||
669 | 669 | */ |
670 | 670 | private function _get_transaction_and_cart_for_previous_visit() { |
671 | 671 | /** @var $TXN_model EEM_Transaction */ |
672 | - $TXN_model = EE_Registry::instance()->load_model( 'Transaction' ); |
|
672 | + $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
673 | 673 | // because the reg_url_link is present in the request, this is a return visit to SPCO, so we'll get the transaction data from the db |
674 | - $transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link ); |
|
674 | + $transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link); |
|
675 | 675 | // verify transaction |
676 | - if ( $transaction instanceof EE_Transaction ) { |
|
676 | + if ($transaction instanceof EE_Transaction) { |
|
677 | 677 | // and get the cart that was used for that transaction |
678 | - $this->checkout->cart = $this->_get_cart_for_transaction( $transaction ); |
|
678 | + $this->checkout->cart = $this->_get_cart_for_transaction($transaction); |
|
679 | 679 | return $transaction; |
680 | 680 | } else { |
681 | - EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
681 | + EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
682 | 682 | return NULL; |
683 | 683 | } |
684 | 684 | } |
@@ -692,11 +692,11 @@ discard block |
||
692 | 692 | * @param EE_Transaction $transaction |
693 | 693 | * @return EE_Cart |
694 | 694 | */ |
695 | - private function _get_cart_for_transaction( $transaction ) { |
|
696 | - $cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction ) : NULL; |
|
695 | + private function _get_cart_for_transaction($transaction) { |
|
696 | + $cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction) : NULL; |
|
697 | 697 | // verify cart |
698 | - if ( ! $cart instanceof EE_Cart ) { |
|
699 | - $cart = EE_Registry::instance()->load_core( 'Cart' ); |
|
698 | + if ( ! $cart instanceof EE_Cart) { |
|
699 | + $cart = EE_Registry::instance()->load_core('Cart'); |
|
700 | 700 | } |
701 | 701 | return $cart; |
702 | 702 | } |
@@ -711,8 +711,8 @@ discard block |
||
711 | 711 | * @param EE_Transaction $transaction |
712 | 712 | * @return EE_Cart |
713 | 713 | */ |
714 | - public function get_cart_for_transaction( EE_Transaction $transaction ) { |
|
715 | - return EE_Cart::get_cart_from_txn( $transaction ); |
|
714 | + public function get_cart_for_transaction(EE_Transaction $transaction) { |
|
715 | + return EE_Cart::get_cart_from_txn($transaction); |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | |
@@ -727,17 +727,17 @@ discard block |
||
727 | 727 | private function _get_cart_for_current_session_and_setup_new_transaction() { |
728 | 728 | // if there's no transaction, then this is the FIRST visit to SPCO |
729 | 729 | // so load up the cart ( passing nothing for the TXN because it doesn't exist yet ) |
730 | - $this->checkout->cart = $this->_get_cart_for_transaction( NULL ); |
|
730 | + $this->checkout->cart = $this->_get_cart_for_transaction(NULL); |
|
731 | 731 | // and then create a new transaction |
732 | 732 | $transaction = $this->_initialize_transaction(); |
733 | 733 | // verify transaction |
734 | - if ( $transaction instanceof EE_Transaction ) { |
|
734 | + if ($transaction instanceof EE_Transaction) { |
|
735 | 735 | // save it so that we have an ID for other objects to use |
736 | 736 | $transaction->save(); |
737 | 737 | // and save TXN data to the cart |
738 | - $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() ); |
|
738 | + $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID()); |
|
739 | 739 | } else { |
740 | - EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
740 | + EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
741 | 741 | } |
742 | 742 | return $transaction; |
743 | 743 | } |
@@ -757,15 +757,15 @@ discard block |
||
757 | 757 | // grab the cart grand total |
758 | 758 | $cart_total = $this->checkout->cart->get_cart_grand_total(); |
759 | 759 | // create new TXN |
760 | - return EE_Transaction::new_instance( array( |
|
760 | + return EE_Transaction::new_instance(array( |
|
761 | 761 | 'TXN_timestamp' => time(), |
762 | 762 | 'TXN_reg_steps' => $this->checkout->initialize_txn_reg_steps_array(), |
763 | 763 | 'TXN_total' => $cart_total > 0 ? $cart_total : 0, |
764 | 764 | 'TXN_paid' => 0, |
765 | 765 | 'STS_ID' => EEM_Transaction::failed_status_code, |
766 | 766 | )); |
767 | - } catch( Exception $e ) { |
|
768 | - EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
767 | + } catch (Exception $e) { |
|
768 | + EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
769 | 769 | } |
770 | 770 | return NULL; |
771 | 771 | } |
@@ -779,34 +779,34 @@ discard block |
||
779 | 779 | * @param EE_Transaction $transaction |
780 | 780 | * @return EE_Cart |
781 | 781 | */ |
782 | - private function _get_registrations( EE_Transaction $transaction ) { |
|
782 | + private function _get_registrations(EE_Transaction $transaction) { |
|
783 | 783 | // first step: grab the registrants { : o |
784 | - $registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, true ); |
|
784 | + $registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true); |
|
785 | 785 | // verify registrations have been set |
786 | - if ( empty( $registrations )) { |
|
786 | + if (empty($registrations)) { |
|
787 | 787 | // if no cached registrations, then check the db |
788 | - $registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, false ); |
|
788 | + $registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false); |
|
789 | 789 | // still nothing ? well as long as this isn't a revisit |
790 | - if ( empty( $registrations ) && ! $this->checkout->revisit ) { |
|
790 | + if (empty($registrations) && ! $this->checkout->revisit) { |
|
791 | 791 | // generate new registrations from scratch |
792 | - $registrations = $this->_initialize_registrations( $transaction ); |
|
792 | + $registrations = $this->_initialize_registrations($transaction); |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | // sort by their original registration order |
796 | - usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' )); |
|
796 | + usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count')); |
|
797 | 797 | // then loop thru the array |
798 | - foreach ( $registrations as $registration ) { |
|
798 | + foreach ($registrations as $registration) { |
|
799 | 799 | // verify each registration |
800 | - if ( $registration instanceof EE_Registration ) { |
|
800 | + if ($registration instanceof EE_Registration) { |
|
801 | 801 | // we display all attendee info for the primary registrant |
802 | - if ( $this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant() ) { |
|
802 | + if ($this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) { |
|
803 | 803 | $this->checkout->primary_revisit = TRUE; |
804 | 804 | break; |
805 | - } else if ( $this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link() ) { |
|
805 | + } else if ($this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link()) { |
|
806 | 806 | // but hide info if it doesn't belong to you |
807 | - $transaction->clear_cache( 'Registration', $registration->ID() ); |
|
807 | + $transaction->clear_cache('Registration', $registration->ID()); |
|
808 | 808 | } |
809 | - $this->checkout->set_reg_status_updated( $registration->ID(), false ); |
|
809 | + $this->checkout->set_reg_status_updated($registration->ID(), false); |
|
810 | 810 | } |
811 | 811 | } |
812 | 812 | } |
@@ -820,17 +820,17 @@ discard block |
||
820 | 820 | * @param EE_Transaction $transaction |
821 | 821 | * @return array |
822 | 822 | */ |
823 | - private function _initialize_registrations( EE_Transaction $transaction ) { |
|
823 | + private function _initialize_registrations(EE_Transaction $transaction) { |
|
824 | 824 | $att_nmbr = 0; |
825 | 825 | $registrations = array(); |
826 | - if ( $transaction instanceof EE_Transaction ) { |
|
826 | + if ($transaction instanceof EE_Transaction) { |
|
827 | 827 | /** @type EE_Registration_Processor $registration_processor */ |
828 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
828 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
829 | 829 | $this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count(); |
830 | 830 | // now let's add the cart items to the $transaction |
831 | - foreach ( $this->checkout->cart->get_tickets() as $line_item ) { |
|
831 | + foreach ($this->checkout->cart->get_tickets() as $line_item) { |
|
832 | 832 | //do the following for each ticket of this type they selected |
833 | - for ( $x = 1; $x <= $line_item->quantity(); $x++ ) { |
|
833 | + for ($x = 1; $x <= $line_item->quantity(); $x++) { |
|
834 | 834 | $att_nmbr++; |
835 | 835 | $registration = $registration_processor->generate_ONE_registration_from_line_item( |
836 | 836 | $line_item, |
@@ -838,12 +838,12 @@ discard block |
||
838 | 838 | $att_nmbr, |
839 | 839 | $this->checkout->total_ticket_count |
840 | 840 | ); |
841 | - if ( $registration instanceof EE_Registration ) { |
|
842 | - $registrations[ $registration->ID() ] = $registration; |
|
841 | + if ($registration instanceof EE_Registration) { |
|
842 | + $registrations[$registration->ID()] = $registration; |
|
843 | 843 | } |
844 | 844 | } |
845 | 845 | } |
846 | - $registration_processor->fix_reg_final_price_rounding_issue( $transaction ); |
|
846 | + $registration_processor->fix_reg_final_price_rounding_issue($transaction); |
|
847 | 847 | } |
848 | 848 | return $registrations; |
849 | 849 | } |
@@ -858,12 +858,12 @@ discard block |
||
858 | 858 | * @param EE_Registration $reg_B |
859 | 859 | * @return array() |
860 | 860 | */ |
861 | - public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) { |
|
861 | + public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) { |
|
862 | 862 | // this shouldn't ever happen within the same TXN, but oh well |
863 | - if ( $reg_A->count() == $reg_B->count() ) { |
|
863 | + if ($reg_A->count() == $reg_B->count()) { |
|
864 | 864 | return 0; |
865 | 865 | } |
866 | - return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1; |
|
866 | + return ($reg_A->count() > $reg_B->count()) ? 1 : -1; |
|
867 | 867 | } |
868 | 868 | |
869 | 869 | |
@@ -878,35 +878,35 @@ discard block |
||
878 | 878 | */ |
879 | 879 | private function _final_verifications() { |
880 | 880 | // filter checkout |
881 | - $this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout ); |
|
881 | + $this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout); |
|
882 | 882 | //verify that current step is still set correctly |
883 | - if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) { |
|
884 | - EE_Error::add_error( __( 'We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
883 | + if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) { |
|
884 | + EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
885 | 885 | return false; |
886 | 886 | } |
887 | 887 | // if returning to SPCO, then verify that primary registrant is set |
888 | - if ( ! empty( $this->checkout->reg_url_link )) { |
|
888 | + if ( ! empty($this->checkout->reg_url_link)) { |
|
889 | 889 | $valid_registrant = $this->checkout->transaction->primary_registration(); |
890 | - if ( ! $valid_registrant instanceof EE_Registration ) { |
|
891 | - EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
890 | + if ( ! $valid_registrant instanceof EE_Registration) { |
|
891 | + EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
892 | 892 | return false; |
893 | 893 | } |
894 | 894 | $valid_registrant = null; |
895 | - foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) { |
|
896 | - if ( $registration instanceof EE_Registration ) { |
|
897 | - if ( $registration->reg_url_link() == $this->checkout->reg_url_link ) { |
|
895 | + foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) { |
|
896 | + if ($registration instanceof EE_Registration) { |
|
897 | + if ($registration->reg_url_link() == $this->checkout->reg_url_link) { |
|
898 | 898 | $valid_registrant = $registration; |
899 | 899 | } |
900 | 900 | } |
901 | 901 | } |
902 | - if ( ! $valid_registrant instanceof EE_Registration ) { |
|
903 | - EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
902 | + if ( ! $valid_registrant instanceof EE_Registration) { |
|
903 | + EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
904 | 904 | return false; |
905 | 905 | } |
906 | 906 | } |
907 | 907 | // now that things have been kinda sufficiently verified, |
908 | 908 | // let's add the checkout to the session so that's available other systems |
909 | - EE_Registry::instance()->SSN->set_checkout( $this->checkout ); |
|
909 | + EE_Registry::instance()->SSN->set_checkout($this->checkout); |
|
910 | 910 | return true; |
911 | 911 | } |
912 | 912 | |
@@ -922,28 +922,28 @@ discard block |
||
922 | 922 | * @access private |
923 | 923 | * @param bool $reinitializing |
924 | 924 | */ |
925 | - private function _initialize_reg_steps( $reinitializing = false ) { |
|
926 | - $this->checkout->set_reg_step_initiated( $this->checkout->current_step ); |
|
925 | + private function _initialize_reg_steps($reinitializing = false) { |
|
926 | + $this->checkout->set_reg_step_initiated($this->checkout->current_step); |
|
927 | 927 | // loop thru all steps to call their individual "initialize" methods and set i18n strings for JS |
928 | - foreach ( $this->checkout->reg_steps as $reg_step ) { |
|
929 | - if ( ! $reg_step->initialize_reg_step() ) { |
|
928 | + foreach ($this->checkout->reg_steps as $reg_step) { |
|
929 | + if ( ! $reg_step->initialize_reg_step()) { |
|
930 | 930 | // if not initialized then maybe this step is being removed... |
931 | - if ( $reg_step->is_current_step() && ! $reinitializing ) { |
|
931 | + if ($reg_step->is_current_step() && ! $reinitializing) { |
|
932 | 932 | // if it was the current step, then we need to start over here |
933 | - $this->_initialize_reg_steps( true ); |
|
933 | + $this->_initialize_reg_steps(true); |
|
934 | 934 | return; |
935 | 935 | } |
936 | 936 | continue; |
937 | 937 | } |
938 | 938 | // i18n |
939 | 939 | $reg_step->translate_js_strings(); |
940 | - if ( $reg_step->is_current_step() ) { |
|
940 | + if ($reg_step->is_current_step()) { |
|
941 | 941 | // the text that appears on the reg step form submit button |
942 | 942 | $reg_step->set_submit_button_text(); |
943 | 943 | } |
944 | 944 | } |
945 | 945 | // dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information |
946 | - do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step ); |
|
946 | + do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step); |
|
947 | 947 | } |
948 | 948 | |
949 | 949 | |
@@ -956,39 +956,39 @@ discard block |
||
956 | 956 | */ |
957 | 957 | private function _check_form_submission() { |
958 | 958 | //does this request require the reg form to be generated ? |
959 | - if ( $this->checkout->generate_reg_form ) { |
|
959 | + if ($this->checkout->generate_reg_form) { |
|
960 | 960 | // ever heard that song by Blue Rodeo ? |
961 | 961 | try { |
962 | 962 | $this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form(); |
963 | 963 | // if not displaying a form, then check for form submission |
964 | - if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) { |
|
964 | + if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) { |
|
965 | 965 | // clear out any old data in case this step is being run again |
966 | - $this->checkout->current_step->set_valid_data( array() ); |
|
966 | + $this->checkout->current_step->set_valid_data(array()); |
|
967 | 967 | // capture submitted form data |
968 | 968 | $this->checkout->current_step->reg_form->receive_form_submission( |
969 | - apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout ) |
|
969 | + apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout) |
|
970 | 970 | ); |
971 | 971 | // validate submitted form data |
972 | - if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg ) { |
|
972 | + if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg) { |
|
973 | 973 | // thou shall not pass !!! |
974 | 974 | $this->checkout->continue_reg = FALSE; |
975 | 975 | // any form validation errors? |
976 | - if ( $this->checkout->current_step->reg_form->submission_error_message() != '' ) { |
|
976 | + if ($this->checkout->current_step->reg_form->submission_error_message() != '') { |
|
977 | 977 | $submission_error_messages = array(); |
978 | 978 | // bad, bad, bad registrant |
979 | - foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){ |
|
980 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
981 | - $submission_error_messages[] = sprintf( __( '%s : %s', 'event_espresso' ), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage() ); |
|
979 | + foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) { |
|
980 | + if ($validation_error instanceof EE_Validation_Error) { |
|
981 | + $submission_error_messages[] = sprintf(__('%s : %s', 'event_espresso'), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage()); |
|
982 | 982 | } |
983 | 983 | } |
984 | - EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ ); |
|
984 | + EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__); |
|
985 | 985 | } |
986 | 986 | // well not really... what will happen is we'll just get redirected back to redo the current step |
987 | 987 | $this->go_to_next_step(); |
988 | 988 | return; |
989 | 989 | } |
990 | 990 | } |
991 | - } catch( EE_Error $e ) { |
|
991 | + } catch (EE_Error $e) { |
|
992 | 992 | $e->get_error(); |
993 | 993 | } |
994 | 994 | } |
@@ -1004,38 +1004,38 @@ discard block |
||
1004 | 1004 | */ |
1005 | 1005 | private function _process_form_action() { |
1006 | 1006 | // what cha wanna do? |
1007 | - switch( $this->checkout->action ) { |
|
1007 | + switch ($this->checkout->action) { |
|
1008 | 1008 | // AJAX next step reg form |
1009 | 1009 | case 'display_spco_reg_step' : |
1010 | 1010 | $this->checkout->redirect = FALSE; |
1011 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
1012 | - $this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() ); |
|
1011 | + if (EE_Registry::instance()->REQ->ajax) { |
|
1012 | + $this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form()); |
|
1013 | 1013 | } |
1014 | 1014 | break; |
1015 | 1015 | |
1016 | 1016 | default : |
1017 | 1017 | // meh... do one of those other steps first |
1018 | - if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) { |
|
1018 | + if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) { |
|
1019 | 1019 | // dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step |
1020 | - do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step ); |
|
1020 | + do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step); |
|
1021 | 1021 | // call action on current step |
1022 | - if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) { |
|
1022 | + if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) { |
|
1023 | 1023 | // good registrant, you get to proceed |
1024 | - if ( $this->checkout->current_step->success_message() != '' ) { |
|
1025 | - if ( apply_filters( 'FHEE__Single_Page_Checkout___process_form_action__display_success', false ) ) { |
|
1026 | - EE_Error::add_success( $this->checkout->current_step->success_message() . '<br />' . $this->checkout->next_step->_instructions() ); |
|
1024 | + if ($this->checkout->current_step->success_message() != '') { |
|
1025 | + if (apply_filters('FHEE__Single_Page_Checkout___process_form_action__display_success', false)) { |
|
1026 | + EE_Error::add_success($this->checkout->current_step->success_message().'<br />'.$this->checkout->next_step->_instructions()); |
|
1027 | 1027 | } |
1028 | 1028 | } |
1029 | 1029 | // pack it up, pack it in... |
1030 | 1030 | $this->_setup_redirect(); |
1031 | 1031 | } |
1032 | 1032 | // dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step |
1033 | - do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step ); |
|
1033 | + do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step); |
|
1034 | 1034 | |
1035 | 1035 | } else { |
1036 | 1036 | EE_Error::add_error( |
1037 | 1037 | sprintf( |
1038 | - __( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ), |
|
1038 | + __('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'), |
|
1039 | 1039 | $this->checkout->action, |
1040 | 1040 | $this->checkout->current_step->name() |
1041 | 1041 | ), |
@@ -1061,10 +1061,10 @@ discard block |
||
1061 | 1061 | public function add_styles_and_scripts() { |
1062 | 1062 | // i18n |
1063 | 1063 | $this->translate_js_strings(); |
1064 | - if ( $this->checkout->admin_request ) { |
|
1065 | - add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 ); |
|
1064 | + if ($this->checkout->admin_request) { |
|
1065 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10); |
|
1066 | 1066 | } else { |
1067 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 ); |
|
1067 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10); |
|
1068 | 1068 | } |
1069 | 1069 | } |
1070 | 1070 | |
@@ -1080,42 +1080,42 @@ discard block |
||
1080 | 1080 | EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit; |
1081 | 1081 | EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link; |
1082 | 1082 | EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso'); |
1083 | - EE_Registry::$i18n_js_strings['invalid_json_response'] = __( 'An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso' ); |
|
1084 | - EE_Registry::$i18n_js_strings['validation_error'] = __( 'There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso' ); |
|
1085 | - EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso' ); |
|
1083 | + EE_Registry::$i18n_js_strings['invalid_json_response'] = __('An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso'); |
|
1084 | + EE_Registry::$i18n_js_strings['validation_error'] = __('There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso'); |
|
1085 | + EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso'); |
|
1086 | 1086 | EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso'); |
1087 | 1087 | EE_Registry::$i18n_js_strings['invalid_coupon'] = __('We\'re sorry but that coupon code does not appear to be valid. If this is incorrect, please contact the site administrator.', 'event_espresso'); |
1088 | - EE_Registry::$i18n_js_strings['process_registration'] = sprintf( __( 'Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso' ), '<br/>', '<br/>' ); |
|
1089 | - EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' ); |
|
1088 | + EE_Registry::$i18n_js_strings['process_registration'] = sprintf(__('Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso'), '<br/>', '<br/>'); |
|
1089 | + EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language'); |
|
1090 | 1090 | EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id(); |
1091 | 1091 | EE_Registry::$i18n_js_strings['currency'] = EE_Registry::instance()->CFG->currency; |
1092 | 1092 | EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20'; |
1093 | - EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' ); |
|
1094 | - EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' ); |
|
1095 | - EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' ); |
|
1096 | - EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' ); |
|
1097 | - EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' ); |
|
1098 | - EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' ); |
|
1099 | - EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' ); |
|
1100 | - EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' ); |
|
1101 | - EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' ); |
|
1102 | - EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' ); |
|
1103 | - EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' ); |
|
1104 | - EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' ); |
|
1105 | - EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' ); |
|
1106 | - EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' ); |
|
1093 | + EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso'); |
|
1094 | + EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso'); |
|
1095 | + EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso'); |
|
1096 | + EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso'); |
|
1097 | + EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso'); |
|
1098 | + EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso'); |
|
1099 | + EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso'); |
|
1100 | + EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso'); |
|
1101 | + EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso'); |
|
1102 | + EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso'); |
|
1103 | + EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso'); |
|
1104 | + EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso'); |
|
1105 | + EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso'); |
|
1106 | + EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso'); |
|
1107 | 1107 | EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf( |
1108 | - __( '%1$sWe\'re sorry, but your registration time has expired.%2$s%3$s%4$sIf you still wish to complete your registration, please return to the %5$sEvent List%6$sEvent List%7$s and reselect your tickets if available. Please except our apologies for any inconvenience this may have caused.%8$s', 'event_espresso' ), |
|
1108 | + __('%1$sWe\'re sorry, but your registration time has expired.%2$s%3$s%4$sIf you still wish to complete your registration, please return to the %5$sEvent List%6$sEvent List%7$s and reselect your tickets if available. Please except our apologies for any inconvenience this may have caused.%8$s', 'event_espresso'), |
|
1109 | 1109 | '<h4 class="important-notice">', |
1110 | 1110 | '</h4>', |
1111 | 1111 | '<br />', |
1112 | 1112 | '<p>', |
1113 | - '<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="', |
|
1113 | + '<a href="'.get_post_type_archive_link('espresso_events').'" title="', |
|
1114 | 1114 | '">', |
1115 | 1115 | '</a>', |
1116 | 1116 | '</p>' |
1117 | 1117 | ); |
1118 | - EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true ); |
|
1118 | + EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true); |
|
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | |
@@ -1128,25 +1128,25 @@ discard block |
||
1128 | 1128 | */ |
1129 | 1129 | public function enqueue_styles_and_scripts() { |
1130 | 1130 | // load css |
1131 | - wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION ); |
|
1132 | - wp_enqueue_style( 'single_page_checkout' ); |
|
1131 | + wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION); |
|
1132 | + wp_enqueue_style('single_page_checkout'); |
|
1133 | 1133 | // load JS |
1134 | - wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery .plugin.min.js', array( 'jquery' ), '1.0.1', TRUE ); |
|
1135 | - wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery .countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE ); |
|
1136 | - wp_register_script( 'single_page_checkout', SPCO_JS_URL . 'single_page_checkout.js', array( 'espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
1137 | - wp_enqueue_script( 'single_page_checkout' ); |
|
1134 | + wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery .plugin.min.js', array('jquery'), '1.0.1', TRUE); |
|
1135 | + wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery .countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE); |
|
1136 | + wp_register_script('single_page_checkout', SPCO_JS_URL.'single_page_checkout.js', array('espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown'), EVENT_ESPRESSO_VERSION, TRUE); |
|
1137 | + wp_enqueue_script('single_page_checkout'); |
|
1138 | 1138 | |
1139 | 1139 | /** |
1140 | 1140 | * global action hook for enqueueing styles and scripts with |
1141 | 1141 | * spco calls. |
1142 | 1142 | */ |
1143 | - do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this ); |
|
1143 | + do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this); |
|
1144 | 1144 | |
1145 | 1145 | /** |
1146 | 1146 | * dynamic action hook for enqueueing styles and scripts with spco calls. |
1147 | 1147 | * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information |
1148 | 1148 | */ |
1149 | - do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this ); |
|
1149 | + do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this); |
|
1150 | 1150 | |
1151 | 1151 | // add css and JS for current step |
1152 | 1152 | $this->checkout->current_step->enqueue_styles_and_scripts(); |
@@ -1162,20 +1162,20 @@ discard block |
||
1162 | 1162 | */ |
1163 | 1163 | private function _display_spco_reg_form() { |
1164 | 1164 | // if registering via the admin, just display the reg form for the current step |
1165 | - if ( $this->checkout->admin_request ) { |
|
1166 | - EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() ); |
|
1165 | + if ($this->checkout->admin_request) { |
|
1166 | + EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form()); |
|
1167 | 1167 | } else { |
1168 | 1168 | // add powered by EE msg |
1169 | - add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' )); |
|
1169 | + add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer')); |
|
1170 | 1170 | |
1171 | - $empty_cart = count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) ) < 1 ? true : false; |
|
1171 | + $empty_cart = count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? true : false; |
|
1172 | 1172 | $cookies_not_set_msg = ''; |
1173 | - if ( $empty_cart ) { |
|
1174 | - if ( ! isset( $_COOKIE[ 'ee_cookie_test' ] ) ) { |
|
1173 | + if ($empty_cart) { |
|
1174 | + if ( ! isset($_COOKIE['ee_cookie_test'])) { |
|
1175 | 1175 | $cookies_not_set_msg = apply_filters( |
1176 | 1176 | 'FHEE__Single_Page_Checkout__display_spco_reg_form__cookies_not_set_msg', |
1177 | 1177 | sprintf( |
1178 | - __( '%1$s%3$sIt appears your browser is not currently set to accept Cookies%4$s%5$sIn order to register for events, you need to enable cookies.%7$sIf you require assistance, then click the following link to learn how to %8$senable cookies%9$s%6$s%2$s', 'event_espresso' ), |
|
1178 | + __('%1$s%3$sIt appears your browser is not currently set to accept Cookies%4$s%5$sIn order to register for events, you need to enable cookies.%7$sIf you require assistance, then click the following link to learn how to %8$senable cookies%9$s%6$s%2$s', 'event_espresso'), |
|
1179 | 1179 | '<div class="ee-attention">', |
1180 | 1180 | '</div>', |
1181 | 1181 | '<h6 class="important-notice">', |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | 'layout_strategy' => |
1197 | 1197 | new EE_Template_Layout( |
1198 | 1198 | array( |
1199 | - 'layout_template_file' => SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php', |
|
1199 | + 'layout_template_file' => SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php', |
|
1200 | 1200 | 'template_args' => array( |
1201 | 1201 | 'empty_cart' => $empty_cart, |
1202 | 1202 | 'revisit' => $this->checkout->revisit, |
@@ -1205,8 +1205,8 @@ discard block |
||
1205 | 1205 | 'empty_msg' => apply_filters( |
1206 | 1206 | 'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg', |
1207 | 1207 | sprintf( |
1208 | - __( 'You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso' ), |
|
1209 | - '<a href="' . get_post_type_archive_link( 'espresso_events' ) . '" title="', |
|
1208 | + __('You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso'), |
|
1209 | + '<a href="'.get_post_type_archive_link('espresso_events').'" title="', |
|
1210 | 1210 | '">', |
1211 | 1211 | '</a>' |
1212 | 1212 | ) |
@@ -1214,14 +1214,14 @@ discard block |
||
1214 | 1214 | 'cookies_not_set_msg' => $cookies_not_set_msg, |
1215 | 1215 | 'registration_time_limit' => $this->checkout->get_registration_time_limit(), |
1216 | 1216 | 'session_expiration' => |
1217 | - gmdate( 'M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) |
|
1217 | + gmdate('M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS)) |
|
1218 | 1218 | ) |
1219 | 1219 | ) |
1220 | 1220 | ) |
1221 | 1221 | ) |
1222 | 1222 | ); |
1223 | 1223 | // load template and add to output sent that gets filtered into the_content() |
1224 | - EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html_and_js() ); |
|
1224 | + EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html_and_js()); |
|
1225 | 1225 | } |
1226 | 1226 | } |
1227 | 1227 | |
@@ -1235,8 +1235,8 @@ discard block |
||
1235 | 1235 | * @internal param string $label |
1236 | 1236 | * @return string |
1237 | 1237 | */ |
1238 | - public function add_extra_finalize_registration_inputs( $next_step ) { |
|
1239 | - if ( $next_step == 'finalize_registration' ) { |
|
1238 | + public function add_extra_finalize_registration_inputs($next_step) { |
|
1239 | + if ($next_step == 'finalize_registration') { |
|
1240 | 1240 | echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>'; |
1241 | 1241 | } |
1242 | 1242 | } |
@@ -1250,18 +1250,18 @@ discard block |
||
1250 | 1250 | * @return string |
1251 | 1251 | */ |
1252 | 1252 | public static function display_registration_footer() { |
1253 | - if ( apply_filters( 'FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer ) ) { |
|
1254 | - EE_Registry::instance()->CFG->admin->affiliate_id = ! empty( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default'; |
|
1255 | - $url = add_query_arg( array( 'ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id ), 'https://eventespresso.com/' ); |
|
1256 | - $url = apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url ); |
|
1253 | + if (apply_filters('FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer)) { |
|
1254 | + EE_Registry::instance()->CFG->admin->affiliate_id = ! empty(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default'; |
|
1255 | + $url = add_query_arg(array('ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id), 'https://eventespresso.com/'); |
|
1256 | + $url = apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url); |
|
1257 | 1257 | echo apply_filters( |
1258 | 1258 | 'FHEE__EE_Front_Controller__display_registration_footer', |
1259 | 1259 | sprintf( |
1260 | - __( '%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso' ), |
|
1261 | - '<div id="espresso-registration-footer-dv"><a href="' . $url . '" title="', |
|
1260 | + __('%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso'), |
|
1261 | + '<div id="espresso-registration-footer-dv"><a href="'.$url.'" title="', |
|
1262 | 1262 | '" target="_blank">', |
1263 | 1263 | '</a>', |
1264 | - '<a href="' . $url . '" title="', |
|
1264 | + '<a href="'.$url.'" title="', |
|
1265 | 1265 | '" target="_blank">', |
1266 | 1266 | '</a></div>' |
1267 | 1267 | ) |
@@ -1292,12 +1292,12 @@ discard block |
||
1292 | 1292 | * @return array |
1293 | 1293 | */ |
1294 | 1294 | private function _setup_redirect() { |
1295 | - if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) { |
|
1295 | + if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) { |
|
1296 | 1296 | $this->checkout->redirect = TRUE; |
1297 | - if ( empty( $this->checkout->redirect_url )) { |
|
1297 | + if (empty($this->checkout->redirect_url)) { |
|
1298 | 1298 | $this->checkout->redirect_url = $this->checkout->next_step->reg_step_url(); |
1299 | 1299 | } |
1300 | - $this->checkout->redirect_url = apply_filters( 'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout ); |
|
1300 | + $this->checkout->redirect_url = apply_filters('FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout); |
|
1301 | 1301 | } |
1302 | 1302 | } |
1303 | 1303 | |
@@ -1310,12 +1310,12 @@ discard block |
||
1310 | 1310 | * @return void |
1311 | 1311 | */ |
1312 | 1312 | public function go_to_next_step() { |
1313 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
1313 | + if (EE_Registry::instance()->REQ->ajax) { |
|
1314 | 1314 | // capture contents of output buffer we started earlier in the request, and insert into JSON response |
1315 | - $this->checkout->json_response->set_unexpected_errors( ob_get_clean() ); |
|
1315 | + $this->checkout->json_response->set_unexpected_errors(ob_get_clean()); |
|
1316 | 1316 | } |
1317 | 1317 | // just return for these conditions |
1318 | - if ( $this->checkout->admin_request || $this->checkout->action == 'redirect_form' || $this->checkout->action == 'update_checkout' ) { |
|
1318 | + if ($this->checkout->admin_request || $this->checkout->action == 'redirect_form' || $this->checkout->action == 'update_checkout') { |
|
1319 | 1319 | return; |
1320 | 1320 | } |
1321 | 1321 | // AJAX response |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | */ |
1337 | 1337 | protected function _handle_json_response() { |
1338 | 1338 | // if this is an ajax request |
1339 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
1339 | + if (EE_Registry::instance()->REQ->ajax) { |
|
1340 | 1340 | // DEBUG LOG |
1341 | 1341 | //$this->checkout->log( |
1342 | 1342 | // __CLASS__, __FUNCTION__, __LINE__, |
@@ -1346,10 +1346,10 @@ discard block |
||
1346 | 1346 | // 'continue_reg' => $this->checkout->continue_reg, |
1347 | 1347 | // ) |
1348 | 1348 | //); |
1349 | - $this->checkout->json_response->set_registration_time_limit( $this->checkout->get_registration_time_limit() ); |
|
1350 | - $this->checkout->json_response->set_payment_amount( $this->checkout->amount_owing ); |
|
1349 | + $this->checkout->json_response->set_registration_time_limit($this->checkout->get_registration_time_limit()); |
|
1350 | + $this->checkout->json_response->set_payment_amount($this->checkout->amount_owing); |
|
1351 | 1351 | // just send the ajax ( |
1352 | - $json_response = apply_filters( 'FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response ); |
|
1352 | + $json_response = apply_filters('FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response); |
|
1353 | 1353 | $this->unlock_transaction(); |
1354 | 1354 | echo $json_response; |
1355 | 1355 | exit(); |
@@ -1366,9 +1366,9 @@ discard block |
||
1366 | 1366 | */ |
1367 | 1367 | protected function _handle_html_redirects() { |
1368 | 1368 | // going somewhere ? |
1369 | - if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) { |
|
1369 | + if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) { |
|
1370 | 1370 | // store notices in a transient |
1371 | - EE_Error::get_notices( false, true, true ); |
|
1371 | + EE_Error::get_notices(false, true, true); |
|
1372 | 1372 | $this->unlock_transaction(); |
1373 | 1373 | // DEBUG LOG |
1374 | 1374 | //$this->checkout->log( |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | // 'headers_list' => headers_list(), |
1380 | 1380 | // ) |
1381 | 1381 | //); |
1382 | - wp_safe_redirect( $this->checkout->redirect_url ); |
|
1382 | + wp_safe_redirect($this->checkout->redirect_url); |
|
1383 | 1383 | exit(); |
1384 | 1384 | } |
1385 | 1385 | } |
@@ -1,7 +1,8 @@ |
||
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 | * Event Espresso |
7 | 8 | * |
@@ -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 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_PMT_Bank extends EE_PMT_Base{ |
|
28 | +class EE_PMT_Bank extends EE_PMT_Base { |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->_pretty_name = __("Bank", 'event_espresso'); |
39 | 39 | parent::__construct($pm_instance); |
40 | 40 | $this->_default_button_url = $this->file_url().'lib'.DS.'bank-logo.png'; |
41 | - $this->_default_description = __( 'Make payment using an electronic funds transfer from your bank.', 'event_espresso' ); |
|
41 | + $this->_default_description = __('Make payment using an electronic funds transfer from your bank.', 'event_espresso'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param \EE_Transaction $transaction |
49 | 49 | * @return NULL |
50 | 50 | */ |
51 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
51 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
52 | 52 | return NULL; |
53 | 53 | } |
54 | 54 | |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | return new EE_Payment_Method_Form(array( |
63 | 63 | 'extra_meta_inputs'=>array( |
64 | 64 | 'page_title'=>new EE_Text_Input(array( |
65 | - 'html_label_text'=> sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()), |
|
65 | + 'html_label_text'=> sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()), |
|
66 | 66 | 'default'=> __("Electronic Funds Transfers", 'event_espresso') |
67 | 67 | )), |
68 | - 'payment_instructions'=>new EE_Text_Area_Input( array( |
|
69 | - 'html_label_text'=> sprintf(__("Payment Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
70 | - 'html_help_text' => __( 'Provide instructions on how registrants can send the bank draft payment. Eg, mention your account name, bank account number, bank name, bank routing code, and bank address, etc.', 'event_espresso' ), |
|
68 | + 'payment_instructions'=>new EE_Text_Area_Input(array( |
|
69 | + 'html_label_text'=> sprintf(__("Payment Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
70 | + 'html_help_text' => __('Provide instructions on how registrants can send the bank draft payment. Eg, mention your account name, bank account number, bank name, bank routing code, and bank address, etc.', 'event_espresso'), |
|
71 | 71 | 'default'=> sprintf( |
72 | 72 | __('Please initiate an electronic payment using the following bank information: %1$sAccount Owner: Luke Skywalker%1$sBank Account # 1234567890%1$sBank Name: Rebellion Bank%1$sRouting Number: 12345%1$sBank Address: 12345 Wookie Rd., Planet Corellian.%1$sPayment must be received within 48 hours of event date.', 'event_espresso'), |
73 | 73 | "\n" |
74 | 74 | ), |
75 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
75 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
76 | 76 | )), |
77 | 77 | ), |
78 | 78 | 'exclude'=>array('PMD_debug_mode') |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @see EE_PMT_Base::help_tabs_config() |
87 | 87 | * @return array |
88 | 88 | */ |
89 | - public function help_tabs_config(){ |
|
89 | + public function help_tabs_config() { |
|
90 | 90 | return array( |
91 | 91 | $this->get_help_tab_name() => array( |
92 | 92 | 'title' => __('Bank Draft Settings', 'event_espresso'), |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * Other gateways may want to override this, such as offline gateways. |
104 | 104 | * @return string |
105 | 105 | */ |
106 | - public function payment_overview_content(EE_Payment $payment){ |
|
106 | + public function payment_overview_content(EE_Payment $payment) { |
|
107 | 107 | EE_Registry::instance()->load_helper('Template'); |
108 | 108 | $extra_meta_for_payment_method = $this->_pm_instance->all_extra_meta_array(); |
109 | 109 | $template_vars = array_merge( |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ), |
116 | 116 | $extra_meta_for_payment_method); |
117 | 117 | return EEH_Template::locate_template( |
118 | - 'payment_methods' . DS . 'Bank'. DS . 'templates' . DS . 'bank_payment_details_content.template.php', |
|
118 | + 'payment_methods'.DS.'Bank'.DS.'templates'.DS.'bank_payment_details_content.template.php', |
|
119 | 119 | $template_vars); |
120 | 120 | } |
121 | 121 |
@@ -1,7 +1,8 @@ |
||
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 | * Event Espresso |
7 | 8 | * |
@@ -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 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_PMT_Invoice extends EE_PMT_Base{ |
|
28 | +class EE_PMT_Invoice extends EE_PMT_Base { |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __construct($pm_instance = NULL) { |
38 | 38 | $this->_pretty_name = __("Invoice", 'event_espresso'); |
39 | - $this->_default_description = __( 'After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso' ); |
|
39 | + $this->_default_description = __('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso'); |
|
40 | 40 | parent::__construct($pm_instance); |
41 | 41 | $this->_default_button_url = $this->file_url().'lib'.DS.'invoice-logo.png'; |
42 | 42 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param \EE_Transaction $transaction |
49 | 49 | * @return NULL |
50 | 50 | */ |
51 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
51 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
52 | 52 | return NULL; |
53 | 53 | } |
54 | 54 | |
@@ -61,53 +61,53 @@ discard block |
||
61 | 61 | public function generate_new_settings_form() { |
62 | 62 | $pdf_payee_input_name = 'pdf_payee_name'; |
63 | 63 | $confirmation_text_input_name = 'page_confirmation_text'; |
64 | - $form = new EE_Payment_Method_Form(array( |
|
64 | + $form = new EE_Payment_Method_Form(array( |
|
65 | 65 | // 'payment_method_type' => $this, |
66 | 66 | 'extra_meta_inputs'=>array( |
67 | 67 | $pdf_payee_input_name => new EE_Text_Input(array( |
68 | - 'html_label_text' => sprintf( __( 'Payee Name %s', 'event_espresso' ), $this->get_help_tab_link()) |
|
68 | + 'html_label_text' => sprintf(__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()) |
|
69 | 69 | )), |
70 | 70 | 'pdf_payee_email' => new EE_Email_Input(array( |
71 | - 'html_label_text' => sprintf( __( 'Payee Email %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
71 | + 'html_label_text' => sprintf(__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()), |
|
72 | 72 | )), |
73 | 73 | 'pdf_payee_tax_number' => new EE_Text_Input(array( |
74 | - 'html_label_text' => sprintf( __( 'Payee Tax Number %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
74 | + 'html_label_text' => sprintf(__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()), |
|
75 | 75 | )), |
76 | - 'pdf_payee_address' => new EE_Text_Area_Input( array( |
|
77 | - 'html_label_text' => sprintf( __( 'Payee Address %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
78 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
76 | + 'pdf_payee_address' => new EE_Text_Area_Input(array( |
|
77 | + 'html_label_text' => sprintf(__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
78 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
79 | 79 | )), |
80 | 80 | 'pdf_instructions'=>new EE_Text_Area_Input(array( |
81 | - 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
81 | + 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
82 | 82 | 'default'=> __("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso'), |
83 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
83 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
84 | 84 | )), |
85 | 85 | 'pdf_logo_image'=>new EE_Admin_File_Uploader_Input(array( |
86 | - 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
86 | + 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
87 | 87 | 'default'=> EE_Config::instance()->organization->logo_url, |
88 | 88 | 'html_help_text'=> __("(Logo for the top left of the invoice)", 'event_espresso'), |
89 | 89 | )), |
90 | 90 | $confirmation_text_input_name =>new EE_Text_Area_Input(array( |
91 | - 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
91 | + 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
92 | 92 | 'default'=> __("Payment must be received within 48 hours of event date. Details about where to send payment is included on the invoice.", 'event_espresso'), |
93 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
93 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
94 | 94 | )), |
95 | 95 | 'page_extra_info'=>new EE_Text_Area_Input(array( |
96 | - 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
97 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
96 | + 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
97 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
98 | 98 | )), |
99 | 99 | ), |
100 | 100 | 'include'=>array( |
101 | - 'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency','PMD_order', |
|
102 | - $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
101 | + 'PMD_ID', 'PMD_name', 'PMD_desc', 'PMD_admin_name', 'PMD_admin_desc', 'PMD_type', 'PMD_slug', 'PMD_open_by_default', 'PMD_button_url', 'PMD_scope', 'Currency', 'PMD_order', |
|
102 | + $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image', |
|
103 | 103 | $confirmation_text_input_name, 'page_extra_info'), |
104 | 104 | )); |
105 | 105 | $form->add_subsections( |
106 | - array( 'header1' => new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_display.template.php' )), |
|
106 | + array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
107 | 107 | $pdf_payee_input_name |
108 | 108 | ); |
109 | 109 | $form->add_subsections( |
110 | - array( 'header2'=>new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php' )), |
|
110 | + array('header2'=>new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
111 | 111 | $confirmation_text_input_name |
112 | 112 | ); |
113 | 113 | return $form; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @see EE_PMT_Base::help_tabs_config() |
121 | 121 | * @return array |
122 | 122 | */ |
123 | - public function help_tabs_config(){ |
|
123 | + public function help_tabs_config() { |
|
124 | 124 | return array( |
125 | 125 | $this->get_help_tab_name() => array( |
126 | 126 | 'title' => __('Invoice Settings', 'event_espresso'), |
@@ -138,17 +138,17 @@ discard block |
||
138 | 138 | * @param \EE_Payment $payment |
139 | 139 | * @return string |
140 | 140 | */ |
141 | - public function payment_overview_content( EE_Payment $payment ){ |
|
141 | + public function payment_overview_content(EE_Payment $payment) { |
|
142 | 142 | EE_Registry::instance()->load_helper('Template'); |
143 | 143 | return EEH_Template::locate_template( |
144 | - 'payment_methods' . DS . 'Invoice'. DS . 'templates'.DS.'invoice_payment_details_content.template.php', |
|
144 | + 'payment_methods'.DS.'Invoice'.DS.'templates'.DS.'invoice_payment_details_content.template.php', |
|
145 | 145 | array_merge( |
146 | 146 | array( |
147 | 147 | 'payment_method' => $this->_pm_instance, |
148 | 148 | 'payment' => $payment, |
149 | 149 | 'page_confirmation_text' => '', |
150 | 150 | 'page_extra_info' => '', |
151 | - 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url( 'html' ) |
|
151 | + 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html') |
|
152 | 152 | ), |
153 | 153 | $this->_pm_instance->all_extra_meta_array() |
154 | 154 | ) |
@@ -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 | * |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | * @param WP $WP |
52 | 52 | * @return void |
53 | 53 | */ |
54 | - public function run( WP $WP ) { |
|
55 | - if ( did_action( 'pre_get_posts' ) && did_action( 'send_headers' ) ) { |
|
54 | + public function run(WP $WP) { |
|
55 | + if (did_action('pre_get_posts') && did_action('send_headers')) { |
|
56 | 56 | global $wp_query; |
57 | 57 | EED_Single_Page_Checkout::load_reg_steps(); |
58 | - EED_Single_Page_Checkout::init( $wp_query ); |
|
58 | + EED_Single_Page_Checkout::init($wp_query); |
|
59 | 59 | } else { |
60 | 60 | // hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called |
61 | - add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 ); |
|
61 | + add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1); |
|
62 | 62 | // this will trigger the EED_Single_Page_Checkout module's run() method during the pre_get_posts hook point, |
63 | 63 | // this allows us to initialize things, enqueue assets, etc, |
64 | - add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'init' ), 10, 1 ); |
|
64 | + add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'init'), 10, 1); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param array $attributes |
75 | 75 | * @return string |
76 | 76 | */ |
77 | - public function process_shortcode( $attributes = array() ) { |
|
77 | + public function process_shortcode($attributes = array()) { |
|
78 | 78 | return EE_Registry::instance()->REQ->get_output(); |
79 | 79 | } |
80 | 80 |
@@ -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 | * |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return void |
92 | 92 | */ |
93 | 93 | public static function set_hooks() { |
94 | - add_action( 'wp_loaded', array( 'EES_Espresso_Thank_You', 'set_definitions' ), 2 ); |
|
94 | + add_action('wp_loaded', array('EES_Espresso_Thank_You', 'set_definitions'), 2); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public static function set_hooks_admin() { |
104 | 104 | // AJAX for IPN monitoring |
105 | - add_filter( 'heartbeat_received', array( 'EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor' ), 10, 3 ); |
|
106 | - add_filter( 'heartbeat_nopriv_received', array( 'EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor' ), 10, 3 ); |
|
107 | - add_action( 'wp_ajax_espresso_resend_reg_confirmation_email', array( 'EES_Espresso_Thank_You', 'resend_reg_confirmation_email' ), 10, 2 ); |
|
108 | - add_action( 'wp_ajax_nopriv_espresso_resend_reg_confirmation_email', array( 'EES_Espresso_Thank_You', 'resend_reg_confirmation_email' ), 10, 2 ); |
|
105 | + add_filter('heartbeat_received', array('EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor'), 10, 3); |
|
106 | + add_filter('heartbeat_nopriv_received', array('EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor'), 10, 3); |
|
107 | + add_action('wp_ajax_espresso_resend_reg_confirmation_email', array('EES_Espresso_Thank_You', 'resend_reg_confirmation_email'), 10, 2); |
|
108 | + add_action('wp_ajax_nopriv_espresso_resend_reg_confirmation_email', array('EES_Espresso_Thank_You', 'resend_reg_confirmation_email'), 10, 2); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | * @return void |
118 | 118 | */ |
119 | 119 | public static function set_definitions() { |
120 | - define( 'THANK_YOU_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
121 | - define( 'THANK_YOU_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
120 | + define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
121 | + define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -130,23 +130,23 @@ discard block |
||
130 | 130 | * @return EE_Transaction |
131 | 131 | */ |
132 | 132 | public function get_txn() { |
133 | - if ( $this->_current_txn instanceof EE_Transaction ) { |
|
133 | + if ($this->_current_txn instanceof EE_Transaction) { |
|
134 | 134 | return $this->_current_txn; |
135 | 135 | } |
136 | - $TXN_model = EE_Registry::instance()->load_model( 'Transaction' ); |
|
137 | - if ( ! $TXN_model instanceof EEM_Transaction ) { |
|
136 | + $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
137 | + if ( ! $TXN_model instanceof EEM_Transaction) { |
|
138 | 138 | EE_Error::add_error( |
139 | - __( 'The transaction model could not be established.', 'event_espresso' ), |
|
139 | + __('The transaction model could not be established.', 'event_espresso'), |
|
140 | 140 | __FILE__, __FUNCTION__, __LINE__ |
141 | 141 | ); |
142 | 142 | return NULL; |
143 | 143 | } |
144 | 144 | //get the transaction. yes, we may have just loaded it, but it may have been updated, or this may be via an ajax request |
145 | - $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link( $this->_reg_url_link ); |
|
145 | + $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link($this->_reg_url_link); |
|
146 | 146 | // verify TXN |
147 | - if ( WP_DEBUG && ! $this->_current_txn instanceof EE_Transaction ) { |
|
147 | + if (WP_DEBUG && ! $this->_current_txn instanceof EE_Transaction) { |
|
148 | 148 | EE_Error::add_error( |
149 | - __( 'No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso' ), |
|
149 | + __('No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso'), |
|
150 | 150 | __FILE__, __FUNCTION__, __LINE__ |
151 | 151 | ); |
152 | 152 | return NULL; |
@@ -163,16 +163,16 @@ discard block |
||
163 | 163 | * @param int $since |
164 | 164 | * @return mixed array of EE_Payment || FALSE |
165 | 165 | */ |
166 | - public function get_txn_payments( $since = 0 ) { |
|
167 | - if ( ! $this->get_txn() ) { |
|
166 | + public function get_txn_payments($since = 0) { |
|
167 | + if ( ! $this->get_txn()) { |
|
168 | 168 | return FALSE; |
169 | 169 | } |
170 | - $args = array( 'order_by' => array( 'PAY_timestamp' => 'ASC' )); |
|
171 | - if ( $since > 0 ) { |
|
172 | - $args[0] = array( 'PAY_timestamp' => array( '>', $since )); |
|
170 | + $args = array('order_by' => array('PAY_timestamp' => 'ASC')); |
|
171 | + if ($since > 0) { |
|
172 | + $args[0] = array('PAY_timestamp' => array('>', $since)); |
|
173 | 173 | } |
174 | 174 | // get array of payments with most recent first |
175 | - $payments = $this->_current_txn->payments( $args ); |
|
175 | + $payments = $this->_current_txn->payments($args); |
|
176 | 176 | // global $wpdb; |
177 | 177 | // echo $wpdb->last_query; |
178 | 178 | // EEH_Debug_Tools::printr( $payments, '$payments <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
@@ -188,19 +188,19 @@ discard block |
||
188 | 188 | * @return void |
189 | 189 | */ |
190 | 190 | private function _get_reg_url_link() { |
191 | - if ( ! empty( $this->_reg_url_link )) { |
|
191 | + if ( ! empty($this->_reg_url_link)) { |
|
192 | 192 | return; |
193 | 193 | } |
194 | 194 | // only do thank you page stuff if we have a REG_url_link in the url |
195 | - if ( WP_DEBUG && ! EE_Registry::instance()->REQ->is_set( 'e_reg_url_link' )) { |
|
195 | + if (WP_DEBUG && ! EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
196 | 196 | EE_Error::add_error( |
197 | - __( 'No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso' ), |
|
197 | + __('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso'), |
|
198 | 198 | __FILE__, __FUNCTION__, __LINE__ |
199 | 199 | ); |
200 | 200 | return; |
201 | 201 | } |
202 | 202 | // check for reg_url_link |
203 | - $this->_reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link' ); |
|
203 | + $this->_reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link'); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | * @param string $reg_url_link |
213 | 213 | * @return string |
214 | 214 | */ |
215 | - public function set_reg_url_link( $reg_url_link = NULL ) { |
|
216 | - $this->_reg_url_link = ! empty( $reg_url_link ) ? $reg_url_link : $this->_reg_url_link; |
|
215 | + public function set_reg_url_link($reg_url_link = NULL) { |
|
216 | + $this->_reg_url_link = ! empty($reg_url_link) ? $reg_url_link : $this->_reg_url_link; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -226,25 +226,25 @@ discard block |
||
226 | 226 | * @param WP $WP |
227 | 227 | * @return void |
228 | 228 | */ |
229 | - public function run( WP $WP ) { |
|
229 | + public function run(WP $WP) { |
|
230 | 230 | // remove site_url() from thank you page URL |
231 | - $thank_you_page_URL = substr( EE_Registry::instance()->CFG->core->thank_you_page_url(), strlen( home_url() ) ); |
|
231 | + $thank_you_page_URL = substr(EE_Registry::instance()->CFG->core->thank_you_page_url(), strlen(home_url())); |
|
232 | 232 | // remove other non-essential details from URL |
233 | - $thank_you_page_URL = trim( parse_url( $thank_you_page_URL, PHP_URL_PATH ), '/' ); |
|
233 | + $thank_you_page_URL = trim(parse_url($thank_you_page_URL, PHP_URL_PATH), '/'); |
|
234 | 234 | // ensure this shortcode doesn't trigger on anything BUT the thank you page |
235 | - if ( isset( $WP->request ) && trim( $WP->request, '/' ) != $thank_you_page_URL ) { |
|
235 | + if (isset($WP->request) && trim($WP->request, '/') != $thank_you_page_URL) { |
|
236 | 236 | return; |
237 | - } else if ( isset( $WP->query_vars['page_id'] ) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id ) { |
|
237 | + } else if (isset($WP->query_vars['page_id']) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id) { |
|
238 | 238 | return; |
239 | 239 | } |
240 | 240 | $this->_get_reg_url_link(); |
241 | 241 | // resend_reg_confirmation_email ? |
242 | - if ( EE_Registry::instance()->REQ->is_set( 'resend' )) { |
|
242 | + if (EE_Registry::instance()->REQ->is_set('resend')) { |
|
243 | 243 | EES_Espresso_Thank_You::resend_reg_confirmation_email(); |
244 | 244 | } |
245 | 245 | // load assets |
246 | - add_action( 'wp_enqueue_scripts', array( $this, 'load_js' ), 10 ); |
|
247 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
246 | + add_action('wp_enqueue_scripts', array($this, 'load_js'), 10); |
|
247 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
248 | 248 | $this->_translate_strings(); |
249 | 249 | } |
250 | 250 | |
@@ -257,18 +257,18 @@ discard block |
||
257 | 257 | * @return void |
258 | 258 | */ |
259 | 259 | protected function _translate_strings() { |
260 | - EE_Registry::$i18n_js_strings[ 'e_reg_url_link' ] = $this->_reg_url_link; |
|
261 | - EE_Registry::$i18n_js_strings[ 'initial_access' ] = time(); |
|
262 | - EE_Registry::$i18n_js_strings[ 'IPN_wait_time' ] = EES_Espresso_Thank_You::IPN_wait_time; |
|
263 | - EE_Registry::$i18n_js_strings[ 'TXN_complete' ] = EEM_Transaction::complete_status_code; |
|
264 | - EE_Registry::$i18n_js_strings[ 'TXN_incomplete' ] = EEM_Transaction::incomplete_status_code; |
|
265 | - EE_Registry::$i18n_js_strings[ 'checking_for_new_payments' ] = __( 'checking for new payments...', 'event_espresso' ); |
|
266 | - EE_Registry::$i18n_js_strings[ 'loading_payment_info' ] = __( 'loading payment information...', 'event_espresso' ); |
|
267 | - EE_Registry::$i18n_js_strings[ 'server_error' ] = __( 'An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again.', 'event_espresso' ); |
|
268 | - EE_Registry::$i18n_js_strings[ 'slow_IPN' ] = apply_filters( |
|
260 | + EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->_reg_url_link; |
|
261 | + EE_Registry::$i18n_js_strings['initial_access'] = time(); |
|
262 | + EE_Registry::$i18n_js_strings['IPN_wait_time'] = EES_Espresso_Thank_You::IPN_wait_time; |
|
263 | + EE_Registry::$i18n_js_strings['TXN_complete'] = EEM_Transaction::complete_status_code; |
|
264 | + EE_Registry::$i18n_js_strings['TXN_incomplete'] = EEM_Transaction::incomplete_status_code; |
|
265 | + EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __('checking for new payments...', 'event_espresso'); |
|
266 | + EE_Registry::$i18n_js_strings['loading_payment_info'] = __('loading payment information...', 'event_espresso'); |
|
267 | + EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again.', 'event_espresso'); |
|
268 | + EE_Registry::$i18n_js_strings['slow_IPN'] = apply_filters( |
|
269 | 269 | 'EES_Espresso_Thank_You__load_js__slow_IPN', |
270 | 270 | sprintf( |
271 | - __( '%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', 'event_espresso' ), |
|
271 | + __('%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', 'event_espresso'), |
|
272 | 272 | '<div id="espresso-thank-you-page-slow-IPN-dv" class="ee-attention jst-left">', |
273 | 273 | '</div>' |
274 | 274 | ) |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | * @return void |
286 | 286 | */ |
287 | 287 | public function load_js() { |
288 | - wp_register_script( 'thank_you_page', THANK_YOU_ASSETS_URL . 'thank_you_page.js', array( 'espresso_core', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
289 | - wp_enqueue_script( 'thank_you_page' ); |
|
288 | + wp_register_script('thank_you_page', THANK_YOU_ASSETS_URL.'thank_you_page.js', array('espresso_core', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE); |
|
289 | + wp_enqueue_script('thank_you_page'); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | |
@@ -299,13 +299,13 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function init() { |
301 | 301 | $this->_get_reg_url_link(); |
302 | - if ( ! $this->get_txn() ) { |
|
303 | - EE_Registry::instance()->load_helper( 'HTML' ); |
|
302 | + if ( ! $this->get_txn()) { |
|
303 | + EE_Registry::instance()->load_helper('HTML'); |
|
304 | 304 | |
305 | 305 | echo EEH_HTML::div( |
306 | - EEH_HTML::h4( __( 'We\'re sorry...', 'event_espresso' ), '', '' ) . |
|
306 | + EEH_HTML::h4(__('We\'re sorry...', 'event_espresso'), '', ''). |
|
307 | 307 | sprintf( |
308 | - __( 'This is a system page for displaying transaction information after a purchase.%1$sYou are most likely seeing this notice because you have navigated to this page%1$sthrough some means other than completing a transaction.%1$sSorry for the disappointment, but you will most likely find nothing of interest here.%1$s%1$s', 'event_espresso' ), |
|
308 | + __('This is a system page for displaying transaction information after a purchase.%1$sYou are most likely seeing this notice because you have navigated to this page%1$sthrough some means other than completing a transaction.%1$sSorry for the disappointment, but you will most likely find nothing of interest here.%1$s%1$s', 'event_espresso'), |
|
309 | 309 | '<br/>' |
310 | 310 | ), |
311 | 311 | '', 'ee-attention' |
@@ -313,22 +313,22 @@ discard block |
||
313 | 313 | return NULL; |
314 | 314 | } |
315 | 315 | // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete" |
316 | - if ( $this->_current_txn->status_ID() == EEM_Transaction::failed_status_code ) { |
|
317 | - $this->_current_txn->set_status( EEM_Transaction::incomplete_status_code ); |
|
316 | + if ($this->_current_txn->status_ID() == EEM_Transaction::failed_status_code) { |
|
317 | + $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code); |
|
318 | 318 | $this->_current_txn->save(); |
319 | 319 | } |
320 | 320 | $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration ? $this->_current_txn->primary_registration() : NULL; |
321 | 321 | $this->_is_primary = $this->_primary_registrant->reg_url_link() == $this->_reg_url_link ? TRUE : FALSE; |
322 | 322 | |
323 | - $show_try_pay_again_link_default = apply_filters( 'AFEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE ); |
|
323 | + $show_try_pay_again_link_default = apply_filters('AFEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE); |
|
324 | 324 | // txn status ? |
325 | - if( $this->_current_txn->is_completed() ){ |
|
325 | + if ($this->_current_txn->is_completed()) { |
|
326 | 326 | $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
327 | - } else if ( $this->_current_txn->is_incomplete() && ( $this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment() )){ |
|
327 | + } else if ($this->_current_txn->is_incomplete() && ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment())) { |
|
328 | 328 | $this->_show_try_pay_again_link = TRUE; |
329 | - } else if ( $this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment() ) { |
|
329 | + } else if ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) { |
|
330 | 330 | // its pending |
331 | - $this->_show_try_pay_again_link = isset( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default; |
|
331 | + $this->_show_try_pay_again_link = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default; |
|
332 | 332 | } else { |
333 | 333 | $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
334 | 334 | } |
@@ -350,18 +350,18 @@ discard block |
||
350 | 350 | } |
351 | 351 | // link to SPCO |
352 | 352 | $revisit_spco_url = add_query_arg( |
353 | - array( 'ee'=>'_register', 'revisit'=>TRUE, 'e_reg_url_link'=>$this->_reg_url_link ), |
|
353 | + array('ee'=>'_register', 'revisit'=>TRUE, 'e_reg_url_link'=>$this->_reg_url_link), |
|
354 | 354 | EE_Registry::instance()->CFG->core->reg_page_url() |
355 | 355 | ); |
356 | 356 | // link to SPCO payment_options |
357 | - $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg( array('step'=>'payment_options' ), $revisit_spco_url ); |
|
357 | + $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg(array('step'=>'payment_options'), $revisit_spco_url); |
|
358 | 358 | // link to SPCO attendee_information |
359 | 359 | $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->edit_attendee_information_url() : FALSE; |
360 | 360 | |
361 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
362 | - EE_Registry::instance()->load_helper( 'Template_Validator' ); |
|
361 | + EE_Registry::instance()->load_helper('Template'); |
|
362 | + EE_Registry::instance()->load_helper('Template_Validator'); |
|
363 | 363 | |
364 | - do_action( 'AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn ); |
|
364 | + do_action('AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn); |
|
365 | 365 | // set no cache headers and constants |
366 | 366 | EE_System::do_not_cache(); |
367 | 367 | |
@@ -377,31 +377,31 @@ discard block |
||
377 | 377 | * @param array $attributes |
378 | 378 | * @return string |
379 | 379 | */ |
380 | - public function process_shortcode( $attributes = array() ) { |
|
380 | + public function process_shortcode($attributes = array()) { |
|
381 | 381 | |
382 | 382 | $this->init(); |
383 | 383 | |
384 | - if ( ! $this->_current_txn instanceof EE_Transaction ) { |
|
384 | + if ( ! $this->_current_txn instanceof EE_Transaction) { |
|
385 | 385 | return EE_Error::get_notices(); |
386 | 386 | } |
387 | 387 | //EE_Registry::instance()->load_helper( 'Debug_Tools' ); |
388 | 388 | //EEH_Debug_Tools::log( __CLASS__, __FUNCTION__, __LINE__, array( $this->_current_txn ), true, 'EE_Transaction: ' . $this->_current_txn->ID() ); |
389 | 389 | // link to receipt |
390 | - $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url( 'html' ); |
|
391 | - if ( ! empty( $template_args['TXN_receipt_url'] )) { |
|
392 | - $template_args['order_conf_desc'] = __( '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', 'event_espresso' ); |
|
390 | + $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url('html'); |
|
391 | + if ( ! empty($template_args['TXN_receipt_url'])) { |
|
392 | + $template_args['order_conf_desc'] = __('%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', 'event_espresso'); |
|
393 | 393 | } else { |
394 | - $template_args['order_conf_desc'] = __( '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', 'event_espresso' ); |
|
394 | + $template_args['order_conf_desc'] = __('%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', 'event_espresso'); |
|
395 | 395 | } |
396 | 396 | $template_args['transaction'] = $this->_current_txn; |
397 | - $template_args['revisit'] = EE_Registry::instance()->REQ->get( 'revisit', FALSE ); |
|
397 | + $template_args['revisit'] = EE_Registry::instance()->REQ->get('revisit', FALSE); |
|
398 | 398 | |
399 | - add_action( 'AHEE__thank_you_page_overview_template__content', array( $this, 'get_registration_details' )); |
|
400 | - if ( $this->_is_primary && ! $this->_current_txn->is_free() ) { |
|
401 | - add_action( 'AHEE__thank_you_page_overview_template__content', array( $this, 'get_ajax_content' )); |
|
399 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_registration_details')); |
|
400 | + if ($this->_is_primary && ! $this->_current_txn->is_free()) { |
|
401 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_ajax_content')); |
|
402 | 402 | } |
403 | 403 | |
404 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-overview.template.php', $template_args, TRUE, TRUE ); |
|
404 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-overview.template.php', $template_args, TRUE, TRUE); |
|
405 | 405 | |
406 | 406 | } |
407 | 407 | |
@@ -418,15 +418,15 @@ discard block |
||
418 | 418 | * @param array $data |
419 | 419 | * @return array |
420 | 420 | */ |
421 | - public static function thank_you_page_IPN_monitor( $response = array(), $data = array() ) { |
|
421 | + public static function thank_you_page_IPN_monitor($response = array(), $data = array()) { |
|
422 | 422 | // does this heartbeat contain our data ? |
423 | - if ( ! isset( $data['espresso_thank_you_page'] )) { |
|
423 | + if ( ! isset($data['espresso_thank_you_page'])) { |
|
424 | 424 | return $response; |
425 | 425 | } |
426 | 426 | // check for reg_url_link in the incoming heartbeat data |
427 | - if ( ! isset( $data['espresso_thank_you_page']['e_reg_url_link'] )) { |
|
428 | - $response['espresso_thank_you_page'] = array ( |
|
429 | - 'errors' => ! empty( $notices['errors'] ) ? $notices['errors'] : __( 'No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso' ) |
|
427 | + if ( ! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
428 | + $response['espresso_thank_you_page'] = array( |
|
429 | + 'errors' => ! empty($notices['errors']) ? $notices['errors'] : __('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso') |
|
430 | 430 | ); |
431 | 431 | return $response; |
432 | 432 | } |
@@ -436,24 +436,24 @@ discard block |
||
436 | 436 | EES_Espresso_Thank_You::set_definitions(); |
437 | 437 | /** @var $espresso_thank_you_page EES_Espresso_Thank_You */ |
438 | 438 | $espresso_thank_you_page = EES_Espresso_Thank_You::instance(); |
439 | - $espresso_thank_you_page->set_reg_url_link( $data['espresso_thank_you_page']['e_reg_url_link'] ); |
|
439 | + $espresso_thank_you_page->set_reg_url_link($data['espresso_thank_you_page']['e_reg_url_link']); |
|
440 | 440 | $espresso_thank_you_page->init(); |
441 | 441 | //get TXN |
442 | 442 | $TXN = $espresso_thank_you_page->get_txn(); |
443 | 443 | // no TXN? then get out |
444 | - if ( ! $TXN instanceof EE_Transaction ) { |
|
444 | + if ( ! $TXN instanceof EE_Transaction) { |
|
445 | 445 | $notices = EE_Error::get_notices(); |
446 | - $response['espresso_thank_you_page'] = array ( |
|
447 | - 'errors' => ! empty( $notices['errors'] ) ? $notices['errors'] : sprintf( __( 'The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', 'event_espresso' ), __LINE__ ) |
|
446 | + $response['espresso_thank_you_page'] = array( |
|
447 | + 'errors' => ! empty($notices['errors']) ? $notices['errors'] : sprintf(__('The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', 'event_espresso'), __LINE__) |
|
448 | 448 | ); |
449 | 449 | return $response; |
450 | 450 | } |
451 | 451 | // grab transient of TXN's status |
452 | - $txn_status = isset( $data['espresso_thank_you_page']['txn_status'] ) ? $data['espresso_thank_you_page']['txn_status'] : NULL; |
|
452 | + $txn_status = isset($data['espresso_thank_you_page']['txn_status']) ? $data['espresso_thank_you_page']['txn_status'] : NULL; |
|
453 | 453 | // has the TXN status changed since we last checked (or empty because this is the first time running through this code)? |
454 | - if ( $txn_status !== $TXN->status_ID() ) { |
|
454 | + if ($txn_status !== $TXN->status_ID()) { |
|
455 | 455 | // switch between two possible basic outcomes |
456 | - switch( $TXN->status_ID()) { |
|
456 | + switch ($TXN->status_ID()) { |
|
457 | 457 | // TXN has been updated in some way |
458 | 458 | case EEM_Transaction::overpaid_status_code: |
459 | 459 | case EEM_Transaction::complete_status_code: |
@@ -468,29 +468,29 @@ discard block |
||
468 | 468 | case EEM_Transaction::failed_status_code: |
469 | 469 | default: |
470 | 470 | // keep on waiting... |
471 | - return $espresso_thank_you_page->_update_server_wait_time( $data['espresso_thank_you_page'] ); |
|
471 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | // or is the TXN still failed (never been updated) ??? |
475 | - } else if ( $TXN->failed() ) { |
|
475 | + } else if ($TXN->failed()) { |
|
476 | 476 | // keep on waiting... |
477 | - return $espresso_thank_you_page->_update_server_wait_time( $data['espresso_thank_you_page'] ); |
|
477 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
478 | 478 | } |
479 | 479 | // TXN is happening so let's get the payments now |
480 | 480 | // if we've already gotten payments then the heartbeat data will contain the timestamp of the last time we checked |
481 | - $since = isset( $data['espresso_thank_you_page']['get_payments_since'] ) ? $data['espresso_thank_you_page']['get_payments_since'] : 0; |
|
481 | + $since = isset($data['espresso_thank_you_page']['get_payments_since']) ? $data['espresso_thank_you_page']['get_payments_since'] : 0; |
|
482 | 482 | // then check for payments |
483 | - $payments = $espresso_thank_you_page->get_txn_payments( $since ); |
|
483 | + $payments = $espresso_thank_you_page->get_txn_payments($since); |
|
484 | 484 | // has a payment been processed ? |
485 | - if ( ! empty( $payments ) || $espresso_thank_you_page->_is_offline_payment_method ) { |
|
486 | - if ( $since ) { |
|
485 | + if ( ! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
486 | + if ($since) { |
|
487 | 487 | $response['espresso_thank_you_page'] = array( |
488 | - 'new_payments' => $espresso_thank_you_page->get_new_payments( $payments ), |
|
488 | + 'new_payments' => $espresso_thank_you_page->get_new_payments($payments), |
|
489 | 489 | 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
490 | 490 | 'txn_status' => $TXN->status_ID() |
491 | 491 | ); |
492 | 492 | } else { |
493 | - $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details( $payments ); |
|
493 | + $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details($payments); |
|
494 | 494 | } |
495 | 495 | // reset time to check for payments |
496 | 496 | $response['espresso_thank_you_page']['get_payments_since'] = time(); |
@@ -510,9 +510,9 @@ discard block |
||
510 | 510 | * @param array $thank_you_page_data thank you page portion of the incoming JSON array from the WP heartbeat data |
511 | 511 | * @return array |
512 | 512 | */ |
513 | - private function _update_server_wait_time( $thank_you_page_data = array() ) { |
|
514 | - $response['espresso_thank_you_page'] = array ( |
|
515 | - 'still_waiting' => isset( $thank_you_page_data['initial_access'] ) ? time() - $thank_you_page_data['initial_access'] : 0, |
|
513 | + private function _update_server_wait_time($thank_you_page_data = array()) { |
|
514 | + $response['espresso_thank_you_page'] = array( |
|
515 | + 'still_waiting' => isset($thank_you_page_data['initial_access']) ? time() - $thank_you_page_data['initial_access'] : 0, |
|
516 | 516 | 'txn_status' => $this->_current_txn->status_ID() |
517 | 517 | ); |
518 | 518 | return $response; |
@@ -535,13 +535,13 @@ discard block |
||
535 | 535 | $template_args['SPCO_attendee_information_url'] = $this->_SPCO_attendee_information_url; |
536 | 536 | |
537 | 537 | $template_args['resend_reg_confirmation_url'] = add_query_arg( |
538 | - array( 'token'=>$this->_reg_url_link, 'resend_reg_confirmation' => 'true' ), |
|
538 | + array('token'=>$this->_reg_url_link, 'resend_reg_confirmation' => 'true'), |
|
539 | 539 | EE_Registry::instance()->CFG->core->thank_you_page_url() |
540 | 540 | ); |
541 | 541 | // verify template arguments |
542 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
543 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_attendee_information_url'], '$SPCO_attendee_information_url'); |
|
544 | - echo EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-registration-details.template.php', $template_args, TRUE, TRUE ); |
|
542 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
543 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_attendee_information_url'], '$SPCO_attendee_information_url'); |
|
544 | + echo EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-registration-details.template.php', $template_args, TRUE, TRUE); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | |
@@ -550,38 +550,38 @@ discard block |
||
550 | 550 | * resend_reg_confirmation_email |
551 | 551 | */ |
552 | 552 | public static function resend_reg_confirmation_email() { |
553 | - EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
554 | - $reg_url_link = EE_Registry::instance()->REQ->get( 'token' ); |
|
553 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
554 | + $reg_url_link = EE_Registry::instance()->REQ->get('token'); |
|
555 | 555 | |
556 | 556 | // was a REG_ID passed ? |
557 | - if ( $reg_url_link ) { |
|
558 | - $registration = EE_Registry::instance()->load_model( 'Registration' )->get_one( array( array( 'REG_url_link' => $reg_url_link ))); |
|
559 | - if ( $registration instanceof EE_Registration ) { |
|
557 | + if ($reg_url_link) { |
|
558 | + $registration = EE_Registry::instance()->load_model('Registration')->get_one(array(array('REG_url_link' => $reg_url_link))); |
|
559 | + if ($registration instanceof EE_Registration) { |
|
560 | 560 | // resend email |
561 | - EED_Messages::process_resend( array( '_REG_ID' => $registration->ID() )); |
|
561 | + EED_Messages::process_resend(array('_REG_ID' => $registration->ID())); |
|
562 | 562 | } else { |
563 | 563 | EE_Error::add_error( |
564 | - __( 'The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', 'event_espresso' ), |
|
564 | + __('The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', 'event_espresso'), |
|
565 | 565 | __FILE__, __FUNCTION__, __LINE__ |
566 | 566 | ); |
567 | 567 | } |
568 | 568 | } else { |
569 | 569 | EE_Error::add_error( |
570 | - __( 'The Registration Confirmation email could not be sent because a registration token is missing or invalid.', 'event_espresso' ), |
|
570 | + __('The Registration Confirmation email could not be sent because a registration token is missing or invalid.', 'event_espresso'), |
|
571 | 571 | __FILE__, __FUNCTION__, __LINE__ |
572 | 572 | ); |
573 | 573 | } |
574 | 574 | // request sent via AJAX ? |
575 | - if ( EE_FRONT_AJAX ) { |
|
576 | - echo json_encode( EE_Error::get_notices( FALSE )); |
|
575 | + if (EE_FRONT_AJAX) { |
|
576 | + echo json_encode(EE_Error::get_notices(FALSE)); |
|
577 | 577 | die(); |
578 | 578 | // or was JS disabled ? |
579 | 579 | } else { |
580 | 580 | // save errors so that they get picked up on the next request |
581 | - EE_Error::get_notices( TRUE, TRUE ); |
|
581 | + EE_Error::get_notices(TRUE, TRUE); |
|
582 | 582 | wp_safe_redirect( |
583 | 583 | add_query_arg( |
584 | - array( 'e_reg_url_link'=> $reg_url_link ), |
|
584 | + array('e_reg_url_link'=> $reg_url_link), |
|
585 | 585 | EE_Registry::instance()->CFG->core->thank_you_page_url() |
586 | 586 | ) |
587 | 587 | ); |
@@ -597,26 +597,26 @@ discard block |
||
597 | 597 | * @return void |
598 | 598 | */ |
599 | 599 | public function get_ajax_content() { |
600 | - if ( ! $this->get_txn() ) { |
|
600 | + if ( ! $this->get_txn()) { |
|
601 | 601 | return; |
602 | 602 | } |
603 | 603 | // first determine which event(s) require pre-approval or not |
604 | 604 | $events = array(); |
605 | 605 | $events_requiring_pre_approval = array(); |
606 | - foreach ( $this->_current_txn->registrations() as $registration ) { |
|
607 | - if ( $registration instanceof EE_Registration ) { |
|
606 | + foreach ($this->_current_txn->registrations() as $registration) { |
|
607 | + if ($registration instanceof EE_Registration) { |
|
608 | 608 | $event = $registration->event(); |
609 | - if ( $event instanceof EE_Event ) { |
|
610 | - if ( $registration->is_not_approved() && $registration->event() instanceof EE_Event ) { |
|
611 | - $events_requiring_pre_approval[ $event->ID() ] = $event; |
|
609 | + if ($event instanceof EE_Event) { |
|
610 | + if ($registration->is_not_approved() && $registration->event() instanceof EE_Event) { |
|
611 | + $events_requiring_pre_approval[$event->ID()] = $event; |
|
612 | 612 | } else { |
613 | - $events[ $event->ID() ] = $event; |
|
613 | + $events[$event->ID()] = $event; |
|
614 | 614 | } |
615 | 615 | } |
616 | 616 | } |
617 | 617 | } |
618 | - $this->display_details_for_events_requiring_pre_approval( $events_requiring_pre_approval ); |
|
619 | - $this->display_details_for_events( $events ); |
|
618 | + $this->display_details_for_events_requiring_pre_approval($events_requiring_pre_approval); |
|
619 | + $this->display_details_for_events($events); |
|
620 | 620 | } |
621 | 621 | |
622 | 622 | |
@@ -628,21 +628,21 @@ discard block |
||
628 | 628 | * @param EE_Event[] $events |
629 | 629 | * @return string |
630 | 630 | */ |
631 | - public function display_details_for_events( $events = array() ) { |
|
632 | - if ( ! empty( $events ) ) { |
|
631 | + public function display_details_for_events($events = array()) { |
|
632 | + if ( ! empty($events)) { |
|
633 | 633 | ?> |
634 | 634 | <div id="espresso-thank-you-page-ajax-content-dv"> |
635 | 635 | <div id="espresso-thank-you-page-ajax-transaction-dv"></div> |
636 | 636 | <div id="espresso-thank-you-page-ajax-payment-dv"></div> |
637 | 637 | <div id="espresso-thank-you-page-ajax-loading-dv"> |
638 | 638 | <div id="ee-ajax-loading-dv" class="left lt-blue-text"> |
639 | - <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"><?php _e( 'loading transaction and payment information...', 'event_espresso' ); ?></span> |
|
639 | + <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"><?php _e('loading transaction and payment information...', 'event_espresso'); ?></span> |
|
640 | 640 | </div> |
641 | - <?php if ( ! $this->_is_offline_payment_method && ! $this->_payments_closed ) : ?> |
|
641 | + <?php if ( ! $this->_is_offline_payment_method && ! $this->_payments_closed) : ?> |
|
642 | 642 | <p id="ee-ajax-loading-pg" class="highlight-bg small-text clear"> |
643 | - <?php echo apply_filters( 'EES_Espresso_Thank_You__get_ajax_content__waiting_for_IPN_msg', __( 'Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', 'event_espresso' ) ); ?> |
|
643 | + <?php echo apply_filters('EES_Espresso_Thank_You__get_ajax_content__waiting_for_IPN_msg', __('Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', 'event_espresso')); ?> |
|
644 | 644 | <br/> |
645 | - <span class="jst-rght ee-block small-text lt-grey-text"><?php _e( 'current wait time ', 'event_espresso' ); ?> |
|
645 | + <span class="jst-rght ee-block small-text lt-grey-text"><?php _e('current wait time ', 'event_espresso'); ?> |
|
646 | 646 | <span id="espresso-thank-you-page-ajax-time-dv">00:00:00</span></span> |
647 | 647 | </p> |
648 | 648 | <?php endif; ?> |
@@ -662,20 +662,20 @@ discard block |
||
662 | 662 | * @param EE_Event[] $events |
663 | 663 | * @return string |
664 | 664 | */ |
665 | - public function display_details_for_events_requiring_pre_approval( $events = array() ) { |
|
666 | - if ( ! empty( $events ) ) { |
|
665 | + public function display_details_for_events_requiring_pre_approval($events = array()) { |
|
666 | + if ( ! empty($events)) { |
|
667 | 667 | ?> |
668 | 668 | <div id = "espresso-thank-you-page-not-approved-message-dv" > |
669 | - <h4 class="orange-text" ><?php _e( 'Important Notice:', 'event_espresso' );?></h4> |
|
669 | + <h4 class="orange-text" ><?php _e('Important Notice:', 'event_espresso'); ?></h4> |
|
670 | 670 | <p id="events-requiring-pre-approval-pg" class="small-text"> |
671 | 671 | <?php echo apply_filters( |
672 | 672 | 'AHEE__EES_Espresso_Thank_You__get_ajax_content__not_approved_message', |
673 | - __( 'The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso' ) |
|
673 | + __('The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso') |
|
674 | 674 | ); ?> |
675 | 675 | </p> |
676 | 676 | <ul class="events-requiring-pre-approval-ul"> |
677 | - <?php foreach ( $events as $event ) { |
|
678 | - if ( $event instanceof EE_Event ) { |
|
677 | + <?php foreach ($events as $event) { |
|
678 | + if ($event instanceof EE_Event) { |
|
679 | 679 | echo '<li><span class="dashicons dashicons-marker ee-icon-size-16 orange-text"></span>', $event->name(), '</li>'; |
680 | 680 | } |
681 | 681 | } ?> |
@@ -699,15 +699,15 @@ discard block |
||
699 | 699 | $template_args = array(); |
700 | 700 | $template_args['transaction'] = $this->_current_txn; |
701 | 701 | $template_args['reg_url_link'] = $this->_reg_url_link; |
702 | - $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name( TRUE ); |
|
702 | + $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name(TRUE); |
|
703 | 703 | // link to SPCO payment_options |
704 | 704 | $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
705 | 705 | $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
706 | 706 | // verify template arguments |
707 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
708 | - EEH_Template_Validator::verify_isnt_null( $template_args['show_try_pay_again_link'], '$show_try_pay_again_link' ); |
|
709 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url' ); |
|
710 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-transaction-details.template.php', $template_args, TRUE, TRUE ); |
|
707 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
708 | + EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link'); |
|
709 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
710 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-transaction-details.template.php', $template_args, TRUE, TRUE); |
|
711 | 711 | } |
712 | 712 | |
713 | 713 | |
@@ -719,9 +719,9 @@ discard block |
||
719 | 719 | * @param EE_Payment $payment |
720 | 720 | * @return string |
721 | 721 | */ |
722 | - public function get_payment_row_html( $payment = NULL ) { |
|
722 | + public function get_payment_row_html($payment = NULL) { |
|
723 | 723 | $html = ''; |
724 | - if ( $payment instanceof EE_Payment ) { |
|
724 | + if ($payment instanceof EE_Payment) { |
|
725 | 725 | if ( |
726 | 726 | $payment->payment_method() instanceof EE_Payment_Method |
727 | 727 | && $payment->payment_method()->is_off_site() |
@@ -730,25 +730,25 @@ discard block |
||
730 | 730 | // considering the registrant has made it to the Thank You page, |
731 | 731 | // any failed payments may actually be pending and the IPN is just slow |
732 | 732 | // so let's |
733 | - $payment->set_status( EEM_Payment::status_id_pending ); |
|
733 | + $payment->set_status(EEM_Payment::status_id_pending); |
|
734 | 734 | } |
735 | - $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined ? '<br /><span class="small-text">' . $payment->gateway_response() . '</span>' : ''; |
|
735 | + $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined ? '<br /><span class="small-text">'.$payment->gateway_response().'</span>' : ''; |
|
736 | 736 | $html .= ' |
737 | 737 | <tr> |
738 | 738 | <td> |
739 | - ' . $payment->timestamp() . ' |
|
739 | + ' . $payment->timestamp().' |
|
740 | 740 | </td> |
741 | 741 | <td> |
742 | - ' . ( $payment->payment_method() instanceof EE_Payment_Method ? $payment->payment_method()->name() : __( 'Unknown', 'event_espresso' ) ) . ' |
|
742 | + ' . ($payment->payment_method() instanceof EE_Payment_Method ? $payment->payment_method()->name() : __('Unknown', 'event_espresso')).' |
|
743 | 743 | </td> |
744 | 744 | <td class="jst-rght"> |
745 | - ' . EEH_Template::format_currency( $payment->amount() ) . ' |
|
745 | + ' . EEH_Template::format_currency($payment->amount()).' |
|
746 | 746 | </td> |
747 | 747 | <td class="jst-rght" style="line-height:1;"> |
748 | - ' . $payment->pretty_status( TRUE ) . $payment_declined_msg . ' |
|
748 | + ' . $payment->pretty_status(TRUE).$payment_declined_msg.' |
|
749 | 749 | </td> |
750 | 750 | </tr>'; |
751 | - do_action( 'AHEE__thank_you_page_payment_details_template__after_each_payment', $payment ); |
|
751 | + do_action('AHEE__thank_you_page_payment_details_template__after_each_payment', $payment); |
|
752 | 752 | } |
753 | 753 | return $html; |
754 | 754 | } |
@@ -762,17 +762,17 @@ discard block |
||
762 | 762 | * @param array $payments |
763 | 763 | * @return string |
764 | 764 | */ |
765 | - public function get_payment_details( $payments = array() ) { |
|
765 | + public function get_payment_details($payments = array()) { |
|
766 | 766 | //prepare variables for displaying |
767 | 767 | $template_args = array(); |
768 | 768 | $template_args['transaction'] = $this->_current_txn; |
769 | 769 | $template_args['reg_url_link'] = $this->_reg_url_link; |
770 | 770 | $template_args['payments'] = array(); |
771 | - foreach ( $payments as $payment ) { |
|
772 | - $template_args['payments'][] = $this->get_payment_row_html( $payment ); |
|
771 | + foreach ($payments as $payment) { |
|
772 | + $template_args['payments'][] = $this->get_payment_row_html($payment); |
|
773 | 773 | } |
774 | 774 | //create a hacky payment object, but dont save it |
775 | - $payment = EE_Payment::new_instance( array( |
|
775 | + $payment = EE_Payment::new_instance(array( |
|
776 | 776 | 'TXN_ID'=>$this->_current_txn->ID(), |
777 | 777 | 'STS_ID'=>EEM_Payment::status_id_pending, |
778 | 778 | 'PAY_timestamp'=>time(), |
@@ -780,21 +780,21 @@ discard block |
||
780 | 780 | 'PMD_ID'=>$this->_current_txn->payment_method_ID() |
781 | 781 | )); |
782 | 782 | $payment_method = $this->_current_txn->payment_method(); |
783 | - if ( $payment_method instanceof EE_Payment_Method && $payment_method->type_obj() instanceof EE_PMT_Base ) { |
|
784 | - $template_args[ 'gateway_content' ] = $payment_method->type_obj()->payment_overview_content( $payment ); |
|
783 | + if ($payment_method instanceof EE_Payment_Method && $payment_method->type_obj() instanceof EE_PMT_Base) { |
|
784 | + $template_args['gateway_content'] = $payment_method->type_obj()->payment_overview_content($payment); |
|
785 | 785 | } else { |
786 | - $template_args[ 'gateway_content' ] = ''; |
|
786 | + $template_args['gateway_content'] = ''; |
|
787 | 787 | } |
788 | 788 | // link to SPCO payment_options |
789 | 789 | $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
790 | 790 | $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
791 | 791 | // verify template arguments |
792 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
793 | - EEH_Template_Validator::verify_isnt_null( $template_args['payments'], '$payments' ); |
|
794 | - EEH_Template_Validator::verify_isnt_null( $template_args['show_try_pay_again_link'], '$show_try_pay_again_link' ); |
|
795 | - EEH_Template_Validator::verify_isnt_null( $template_args['gateway_content'], '$gateway_content'); |
|
796 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
797 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE ); |
|
792 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
793 | + EEH_Template_Validator::verify_isnt_null($template_args['payments'], '$payments'); |
|
794 | + EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link'); |
|
795 | + EEH_Template_Validator::verify_isnt_null($template_args['gateway_content'], '$gateway_content'); |
|
796 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
797 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE); |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | |
@@ -806,11 +806,11 @@ discard block |
||
806 | 806 | * @param array $payments |
807 | 807 | * @return string |
808 | 808 | */ |
809 | - public function get_new_payments( $payments = array() ) { |
|
809 | + public function get_new_payments($payments = array()) { |
|
810 | 810 | $payments_html = ''; |
811 | 811 | //prepare variables for displaying |
812 | - foreach ( $payments as $payment ) { |
|
813 | - $payments_html .= $this->get_payment_row_html( $payment ); |
|
812 | + foreach ($payments as $payment) { |
|
813 | + $payments_html .= $this->get_payment_row_html($payment); |
|
814 | 814 | } |
815 | 815 | return $payments_html; |
816 | 816 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This is the template for the html messenger and receipt message type attendee_list field. |
|
4 | - */ |
|
3 | + * This is the template for the html messenger and receipt message type attendee_list field. |
|
4 | + */ |
|
5 | 5 | ?> |
6 | 6 | <li class="ticket-registration"> |
7 | 7 | <table class="registration-details"> |
@@ -6,11 +6,11 @@ |
||
6 | 6 | <li class="ticket-registration"> |
7 | 7 | <table class="registration-details"> |
8 | 8 | <tr class="odd"> |
9 | - <th><?php _e('Attendee', 'event_espresso');?></th> |
|
9 | + <th><?php _e('Attendee', 'event_espresso'); ?></th> |
|
10 | 10 | <td>[FNAME] [LNAME] ([ATTENDEE_EMAIL])</td> |
11 | 11 | </tr> |
12 | 12 | <tr> |
13 | - <th><?php _e("Registration Code:", "event_espresso");?></th> |
|
13 | + <th><?php _e("Registration Code:", "event_espresso"); ?></th> |
|
14 | 14 | <td>[REGISTRATION_CODE] - <span class="[REGISTRATION_STATUS_ID]">[REGISTRATION_STATUS_LABEL]</span></td> |
15 | 15 | </tr> |
16 | 16 | </table> |