@@ -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 | /** |
@@ -58,96 +58,96 @@ discard block |
||
58 | 58 | '[CO_GOOGLE_URL]' => esc_html__('Link to organization Google page', 'event_espresso'), |
59 | 59 | '[CO_LINKEDIN_URL]' => esc_html__('Link to organization LinkedIn page', 'event_espresso'), |
60 | 60 | '[CO_INSTAGRAM_URL]' => esc_html__('Link to organization Instagram page', 'event_espresso'), |
61 | - '[CO_TAX_NUMBER_*]' => sprintf( esc_html__('This is the shortcode used for displaying any tax number for the company. %1$sNote: This is a special dynamic shortcode.%2$s You can use the "prefix" parameter to indicate what the prefix for this tax number is. It defaults to "VAT/Tax Number:". To change this prefix you do the following format for this shortcode: [CO_TAX_NUMBER_* prefix="GST: "] and that will output: GST: 12345t56. Also take note that if you have NO number in your settings, the prefix is not output either.', 'event_espresso' ),'<strong>','</strong>') |
|
61 | + '[CO_TAX_NUMBER_*]' => sprintf(esc_html__('This is the shortcode used for displaying any tax number for the company. %1$sNote: This is a special dynamic shortcode.%2$s You can use the "prefix" parameter to indicate what the prefix for this tax number is. It defaults to "VAT/Tax Number:". To change this prefix you do the following format for this shortcode: [CO_TAX_NUMBER_* prefix="GST: "] and that will output: GST: 12345t56. Also take note that if you have NO number in your settings, the prefix is not output either.', 'event_espresso'), '<strong>', '</strong>') |
|
62 | 62 | ); |
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | - protected function _parser( $shortcode ) { |
|
66 | + protected function _parser($shortcode) { |
|
67 | 67 | |
68 | - switch ( $shortcode ) { |
|
68 | + switch ($shortcode) { |
|
69 | 69 | |
70 | 70 | case '[COMPANY]' : |
71 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
71 | + return EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
72 | 72 | break; |
73 | 73 | |
74 | 74 | case '[CO_ADD1]' : |
75 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'address_1' ); |
|
75 | + return EE_Registry::instance()->CFG->organization->get_pretty('address_1'); |
|
76 | 76 | break; |
77 | 77 | |
78 | 78 | case '[CO_ADD2]' : |
79 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'address_2' ); |
|
79 | + return EE_Registry::instance()->CFG->organization->get_pretty('address_2'); |
|
80 | 80 | break; |
81 | 81 | |
82 | 82 | case '[CO_CITY]' : |
83 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'city' ); |
|
83 | + return EE_Registry::instance()->CFG->organization->get_pretty('city'); |
|
84 | 84 | break; |
85 | 85 | |
86 | 86 | case '[CO_STATE]' : |
87 | - $state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( EE_Registry::instance()->CFG->organization->STA_ID ); |
|
87 | + $state = EE_Registry::instance()->load_model('State')->get_one_by_ID(EE_Registry::instance()->CFG->organization->STA_ID); |
|
88 | 88 | return $state->name(); |
89 | 89 | break; |
90 | 90 | |
91 | 91 | case '[CO_ZIP]' : |
92 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'zip' ); |
|
92 | + return EE_Registry::instance()->CFG->organization->get_pretty('zip'); |
|
93 | 93 | break; |
94 | 94 | |
95 | 95 | case '[CO_EMAIL]' : |
96 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
96 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
97 | 97 | break; |
98 | 98 | |
99 | 99 | case '[CO_PHONE]' : |
100 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'phone' ); |
|
100 | + return EE_Registry::instance()->CFG->organization->get_pretty('phone'); |
|
101 | 101 | break; |
102 | 102 | |
103 | 103 | case '[CO_LOGO]' : |
104 | - return '<img src="' . EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ) . '" id="headerImage" />'; |
|
104 | + return '<img src="'.EE_Registry::instance()->CFG->organization->get_pretty('logo_url').'" id="headerImage" />'; |
|
105 | 105 | break; |
106 | 106 | |
107 | 107 | case '[CO_LOGO_URL]' : |
108 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
108 | + return EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
109 | 109 | break; |
110 | 110 | |
111 | 111 | case '[CO_FACEBOOK_URL]' : |
112 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
112 | + return EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
113 | 113 | break; |
114 | 114 | |
115 | 115 | case '[CO_TWITTER_URL]' : |
116 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
116 | + return EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
117 | 117 | break; |
118 | 118 | |
119 | 119 | case '[CO_PINTEREST_URL]' : |
120 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
120 | + return EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
121 | 121 | break; |
122 | 122 | |
123 | 123 | case '[CO_LINKEDIN_URL]' : |
124 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
124 | + return EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
125 | 125 | break; |
126 | 126 | |
127 | 127 | case '[CO_GOOGLE_URL]' : |
128 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
128 | + return EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
129 | 129 | break; |
130 | 130 | |
131 | 131 | case '[CO_INSTAGRAM_URL]' : |
132 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
132 | + return EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
133 | 133 | break; |
134 | 134 | |
135 | 135 | } |
136 | 136 | |
137 | 137 | //also allow for parameter shortcode |
138 | - if ( strpos( $shortcode, '[CO_TAX_NUMBER_*' ) !== FALSE ) { |
|
138 | + if (strpos($shortcode, '[CO_TAX_NUMBER_*') !== FALSE) { |
|
139 | 139 | //first see if there is any company tax number set and bail early if not |
140 | 140 | $tax_number = EE_Registry::instance()->CFG->organization->vat; |
141 | - if ( empty( $tax_number ) ) { |
|
141 | + if (empty($tax_number)) { |
|
142 | 142 | return ''; |
143 | 143 | } |
144 | 144 | |
145 | 145 | //see if there are any attributes. |
146 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
146 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
147 | 147 | |
148 | 148 | //set custom attrs if present (or default) |
149 | - $prefix = isset( $attrs['prefix'] ) ? $attrs['prefix'] : esc_html__('VAT/Tax Number: ', 'event_espresso'); |
|
150 | - return $prefix . $tax_number; |
|
149 | + $prefix = isset($attrs['prefix']) ? $attrs['prefix'] : esc_html__('VAT/Tax Number: ', 'event_espresso'); |
|
150 | + return $prefix.$tax_number; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return ''; |
@@ -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,14 +147,14 @@ 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 ); |
|
157 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -166,27 +166,27 @@ discard block |
||
166 | 166 | * @param string $template |
167 | 167 | * @return string |
168 | 168 | */ |
169 | - public function template_include( $template ) { |
|
169 | + public function template_include($template) { |
|
170 | 170 | global $post; |
171 | 171 | /** @type EE_Event_Single_Config $config */ |
172 | 172 | $config = $this->config(); |
173 | - if ( $config->display_status_banner_single ) { |
|
174 | - add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 ); |
|
173 | + if ($config->display_status_banner_single) { |
|
174 | + add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2); |
|
175 | 175 | } |
176 | 176 | // not a custom template? |
177 | 177 | if ( |
178 | - EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'single-espresso_events.php' |
|
179 | - || apply_filters( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE ) |
|
180 | - && ! post_password_required( $post ) |
|
178 | + EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'single-espresso_events.php' |
|
179 | + || apply_filters('FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE) |
|
180 | + && ! post_password_required($post) |
|
181 | 181 | ) { |
182 | 182 | EEH_Template::load_espresso_theme_functions(); |
183 | 183 | // then add extra event data via hooks |
184 | - add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' )); |
|
185 | - add_filter( 'get_the_excerpt', array( 'EED_Event_Single', 'get_the_excerpt' ), 1, 1 ); |
|
186 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
187 | - add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' )); |
|
184 | + add_action('loop_start', array('EED_Event_Single', 'loop_start')); |
|
185 | + add_filter('get_the_excerpt', array('EED_Event_Single', 'get_the_excerpt'), 1, 1); |
|
186 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
187 | + add_action('loop_end', array('EED_Event_Single', 'loop_end')); |
|
188 | 188 | // don't display entry meta because the existing theme will take car of that |
189 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
189 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
190 | 190 | } |
191 | 191 | return $template; |
192 | 192 | } |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | * @param array $wp_query_array an array containing the WP_Query object |
201 | 201 | * @return void |
202 | 202 | */ |
203 | - public static function loop_start( $wp_query_array ) { |
|
203 | + public static function loop_start($wp_query_array) { |
|
204 | 204 | global $post; |
205 | - do_action( 'AHEE_event_details_before_post', $post, $wp_query_array ); |
|
205 | + do_action('AHEE_event_details_before_post', $post, $wp_query_array); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | * @param int $id |
216 | 216 | * @return string |
217 | 217 | */ |
218 | - public static function the_title( $title = '', $id = 0 ) { |
|
218 | + public static function the_title($title = '', $id = 0) { |
|
219 | 219 | global $post; |
220 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
220 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | * @param string $excerpt |
230 | 230 | * @return string |
231 | 231 | */ |
232 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
232 | + public static function get_the_excerpt($excerpt = '') { |
|
233 | 233 | EED_Event_Single::$using_get_the_excerpt = true; |
234 | - add_filter( 'wp_trim_excerpt', array( 'EED_Event_Single', 'end_get_the_excerpt' ), 999, 1 ); |
|
234 | + add_filter('wp_trim_excerpt', array('EED_Event_Single', 'end_get_the_excerpt'), 999, 1); |
|
235 | 235 | return $excerpt; |
236 | 236 | } |
237 | 237 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @param string $text |
245 | 245 | * @return string |
246 | 246 | */ |
247 | - public static function end_get_the_excerpt( $text = '' ) { |
|
247 | + public static function end_get_the_excerpt($text = '') { |
|
248 | 248 | EED_Event_Single::$using_get_the_excerpt = false; |
249 | 249 | return $text; |
250 | 250 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * @param string $content |
259 | 259 | * @return string |
260 | 260 | */ |
261 | - public static function event_details( $content ) { |
|
261 | + public static function event_details($content) { |
|
262 | 262 | global $post; |
263 | 263 | static $current_post_ID = 0; |
264 | 264 | if ( |
@@ -273,15 +273,15 @@ discard block |
||
273 | 273 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
274 | 274 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
275 | 275 | // so the following allows this filter to be applied multiple times, but only once for real |
276 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
277 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) { |
|
276 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
277 | + if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) { |
|
278 | 278 | // we need to first remove this callback from being applied to the_content() |
279 | 279 | // (otherwise it will recurse and blow up the interweb) |
280 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
280 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
281 | 281 | EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts(); |
282 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
283 | - $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content ); |
|
284 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
282 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
283 | + $content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content); |
|
284 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
285 | 285 | } else { |
286 | 286 | $content = EED_Event_Single::use_filterable_display_order(); |
287 | 287 | } |
@@ -302,19 +302,19 @@ discard block |
||
302 | 302 | // it uses the_content() for displaying the $post->post_content |
303 | 303 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
304 | 304 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
305 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
305 | + remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
306 | 306 | //now add additional content |
307 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 ); |
|
308 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 ); |
|
309 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 ); |
|
310 | - do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' ); |
|
307 | + add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1); |
|
308 | + add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1); |
|
309 | + add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1); |
|
310 | + do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters'); |
|
311 | 311 | // now load our template |
312 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
312 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
313 | 313 | //now add our filter back in, plus some others |
314 | - add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 ); |
|
315 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 ); |
|
316 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 ); |
|
317 | - remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 ); |
|
314 | + add_filter('the_content', array('EED_Event_Single', 'event_details'), 100); |
|
315 | + remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110); |
|
316 | + remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120); |
|
317 | + remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130); |
|
318 | 318 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
319 | 319 | return $content; |
320 | 320 | } |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | * @param string $content |
329 | 329 | * @return string |
330 | 330 | */ |
331 | - public static function event_datetimes( $content ) { |
|
332 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
331 | + public static function event_datetimes($content) { |
|
332 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | * @param string $content |
342 | 342 | * @return string |
343 | 343 | */ |
344 | - public static function event_tickets( $content ) { |
|
345 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
344 | + public static function event_tickets($content) { |
|
345 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | * @param string $content |
355 | 355 | * @return string |
356 | 356 | */ |
357 | - public static function event_venue( $content ) { |
|
358 | - return EED_Event_Single::event_venues( $content ); |
|
357 | + public static function event_venue($content) { |
|
358 | + return EED_Event_Single::event_venues($content); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | |
@@ -367,8 +367,8 @@ discard block |
||
367 | 367 | * @param string $content |
368 | 368 | * @return string |
369 | 369 | */ |
370 | - public static function event_venues( $content ) { |
|
371 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
370 | + public static function event_venues($content) { |
|
371 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | |
@@ -380,9 +380,9 @@ discard block |
||
380 | 380 | * @param array $wp_query_array an array containing the WP_Query object |
381 | 381 | * @return void |
382 | 382 | */ |
383 | - public static function loop_end( $wp_query_array ) { |
|
383 | + public static function loop_end($wp_query_array) { |
|
384 | 384 | global $post; |
385 | - do_action( 'AHEE_event_details_after_post', $post, $wp_query_array ); |
|
385 | + do_action('AHEE_event_details_after_post', $post, $wp_query_array); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | |
@@ -395,16 +395,16 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function wp_enqueue_scripts() { |
397 | 397 | // get some style |
398 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) { |
|
398 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) { |
|
399 | 399 | // first check uploads folder |
400 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
401 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
400 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
401 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
402 | 402 | } else { |
403 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
403 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
404 | 404 | } |
405 | - wp_enqueue_script( $this->theme ); |
|
406 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
407 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
405 | + wp_enqueue_script($this->theme); |
|
406 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
407 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
408 | 408 | } |
409 | 409 | } |
410 | 410 | } |
@@ -425,9 +425,9 @@ discard block |
||
425 | 425 | public static function display_venue() { |
426 | 426 | /** @type EE_Event_Single_Config $config */ |
427 | 427 | $config = EED_Event_Single::instance()->config(); |
428 | - $display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE; |
|
428 | + $display_venue = isset($config->display_venue) ? $config->display_venue : TRUE; |
|
429 | 429 | $venue_name = EEH_Venue_View::venue_name(); |
430 | - return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE; |
|
430 | + return $display_venue && ! empty($venue_name) ? TRUE : FALSE; |
|
431 | 431 | } |
432 | 432 | |
433 | 433 |
@@ -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 | * |
@@ -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 | } |
@@ -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,72 +123,72 @@ 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 | - $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 | + $location = espresso_venue_raw_address('inline', $venue->ID(), FALSE); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | // set variables, escape strings, convert timestamps to ics format, etc |
147 | - $filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics'; |
|
148 | - $organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name ); |
|
149 | - $UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() )); |
|
150 | - $org_email = EED_Ical::_escape_ICal_data( $datetime->ID() ); |
|
151 | - $timestamp = date( EED_Ical::iCal_datetime_format ); |
|
152 | - $location = EED_Ical::_escape_ICal_data( $location ); |
|
153 | - $summary = EED_Ical::_escape_ICal_data( $event->name() ); |
|
154 | - $description = EED_Ical::_escape_ICal_description( wp_strip_all_tags( $event->description() )); |
|
147 | + $filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics'; |
|
148 | + $organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name); |
|
149 | + $UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID())); |
|
150 | + $org_email = EED_Ical::_escape_ICal_data($datetime->ID()); |
|
151 | + $timestamp = date(EED_Ical::iCal_datetime_format); |
|
152 | + $location = EED_Ical::_escape_ICal_data($location); |
|
153 | + $summary = EED_Ical::_escape_ICal_data($event->name()); |
|
154 | + $description = EED_Ical::_escape_ICal_description(wp_strip_all_tags($event->description())); |
|
155 | 155 | $status = $datetime->get_active_status(); |
156 | 156 | $status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed'; |
157 | - $status = EED_Ical::_escape_ICal_data( $status ); |
|
158 | - $categories = EED_Ical::_escape_ICal_data( $category ); |
|
159 | - $url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() )); |
|
160 | - $dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() )); |
|
161 | - $dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() )); |
|
157 | + $status = EED_Ical::_escape_ICal_data($status); |
|
158 | + $categories = EED_Ical::_escape_ICal_data($category); |
|
159 | + $url = EED_Ical::_escape_ICal_data(get_permalink($event->ID())); |
|
160 | + $dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start())); |
|
161 | + $dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end())); |
|
162 | 162 | // set headers |
163 | - header( 'Content-type: text/calendar; charset=utf-8' ); |
|
164 | - header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); |
|
165 | - header( 'Cache-Control: private, max-age=0, must-revalidate' ); |
|
166 | - header( 'Pragma: public' ); |
|
167 | - header( 'Content-Type: application/octet-stream' ); |
|
168 | - header( 'Content-Type: application/force-download' ); |
|
169 | - header( 'Cache-Control: no-cache, must-revalidate' ); |
|
170 | - header( 'Content-Transfer-Encoding: binary' ); |
|
171 | - header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date |
|
172 | - ini_set( 'zlib.output_compression', '0' ); |
|
163 | + header('Content-type: text/calendar; charset=utf-8'); |
|
164 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
165 | + header('Cache-Control: private, max-age=0, must-revalidate'); |
|
166 | + header('Pragma: public'); |
|
167 | + header('Content-Type: application/octet-stream'); |
|
168 | + header('Content-Type: application/force-download'); |
|
169 | + header('Cache-Control: no-cache, must-revalidate'); |
|
170 | + header('Content-Transfer-Encoding: binary'); |
|
171 | + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date |
|
172 | + ini_set('zlib.output_compression', '0'); |
|
173 | 173 | // echo the output |
174 | - echo "BEGIN:VCALENDAR" . PHP_EOL; |
|
175 | - echo "VERSION:2.0" . PHP_EOL; |
|
176 | - echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL; |
|
177 | - echo "CALSCALE:GREGORIAN" . PHP_EOL; |
|
178 | - echo "BEGIN:VEVENT" . PHP_EOL; |
|
179 | - echo "UID:{$UID}" . PHP_EOL; |
|
180 | - echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL; |
|
181 | - echo "DTSTAMP:{$timestamp}" . PHP_EOL; |
|
182 | - echo "LOCATION:{$location}" . PHP_EOL; |
|
183 | - echo "SUMMARY:{$summary}" . PHP_EOL; |
|
184 | - echo "DESCRIPTION:{$description}" . PHP_EOL; |
|
185 | - echo "STATUS:{$status}" . PHP_EOL; |
|
186 | - echo "CATEGORIES:{$categories}" . PHP_EOL; |
|
187 | - echo "URL;VALUE=URI:{$url}" . PHP_EOL; |
|
188 | - echo "DTSTART:{$dtt_start}" . PHP_EOL; |
|
189 | - echo "DTEND:{$dtt_end}" . PHP_EOL; |
|
190 | - echo "END:VEVENT" . PHP_EOL; |
|
191 | - echo "END:VCALENDAR" . PHP_EOL; |
|
174 | + echo "BEGIN:VCALENDAR".PHP_EOL; |
|
175 | + echo "VERSION:2.0".PHP_EOL; |
|
176 | + echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL; |
|
177 | + echo "CALSCALE:GREGORIAN".PHP_EOL; |
|
178 | + echo "BEGIN:VEVENT".PHP_EOL; |
|
179 | + echo "UID:{$UID}".PHP_EOL; |
|
180 | + echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL; |
|
181 | + echo "DTSTAMP:{$timestamp}".PHP_EOL; |
|
182 | + echo "LOCATION:{$location}".PHP_EOL; |
|
183 | + echo "SUMMARY:{$summary}".PHP_EOL; |
|
184 | + echo "DESCRIPTION:{$description}".PHP_EOL; |
|
185 | + echo "STATUS:{$status}".PHP_EOL; |
|
186 | + echo "CATEGORIES:{$categories}".PHP_EOL; |
|
187 | + echo "URL;VALUE=URI:{$url}".PHP_EOL; |
|
188 | + echo "DTSTART:{$dtt_start}".PHP_EOL; |
|
189 | + echo "DTEND:{$dtt_end}".PHP_EOL; |
|
190 | + echo "END:VEVENT".PHP_EOL; |
|
191 | + echo "END:VCALENDAR".PHP_EOL; |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | die(); |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | * @param string $string |
204 | 204 | * @return string |
205 | 205 | */ |
206 | - private static function _escape_ICal_data( $string = '' ) { |
|
207 | - return preg_replace( '/([\,;])/', '\\\$1', $string ); |
|
206 | + private static function _escape_ICal_data($string = '') { |
|
207 | + return preg_replace('/([\,;])/', '\\\$1', $string); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -214,13 +214,13 @@ discard block |
||
214 | 214 | * @param string $description |
215 | 215 | * @return string |
216 | 216 | */ |
217 | - private static function _escape_ICal_description( $description = '' ) { |
|
217 | + private static function _escape_ICal_description($description = '') { |
|
218 | 218 | |
219 | 219 | //Escape spcial chars within the decription |
220 | - $description = EED_Ical::_escape_ICal_data( $description ); |
|
220 | + $description = EED_Ical::_escape_ICal_data($description); |
|
221 | 221 | |
222 | 222 | //Remove line breaks and output in iCal format |
223 | - $description = str_replace( array( "\r\n", "\n"), '\n', $description ); |
|
223 | + $description = str_replace(array("\r\n", "\n"), '\n', $description); |
|
224 | 224 | |
225 | 225 | return $description; |
226 | 226 | } |
@@ -808,7 +808,7 @@ |
||
808 | 808 | |
809 | 809 | } // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) { |
810 | 810 | |
811 | - } else { |
|
811 | + } else { |
|
812 | 812 | EE_Error::add_error( __( 'An invalid or missing line item ID was encountered while attempting to process the registration form.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
813 | 813 | // remove malformed data |
814 | 814 | unset( $valid_data[ $reg_url_link ] ); |
@@ -588,6 +588,7 @@ discard block |
||
588 | 588 | * @param EE_Registration $registration |
589 | 589 | * @param EE_Question $question |
590 | 590 | * @param mixed EE_Answer|NULL $answer |
591 | + * @param EE_Answer $answer |
|
591 | 592 | * @return EE_Form_Input_Base |
592 | 593 | * @throws \EE_Error |
593 | 594 | */ |
@@ -1190,7 +1191,7 @@ discard block |
||
1190 | 1191 | * |
1191 | 1192 | * @param EE_Registration $registration |
1192 | 1193 | * @param array $attendee_data |
1193 | - * @return boolean|EE_Attendee |
|
1194 | + * @return EE_Attendee |
|
1194 | 1195 | * @throws \EE_Error |
1195 | 1196 | */ |
1196 | 1197 | private function _find_existing_attendee( EE_Registration $registration, $attendee_data = array() ) { |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_SPCO_Reg_Step_Attendee_Information |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_SPCO_Reg_Step_Attendee_Information |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_SPCO_Reg_Step_Attendee_Information extends EE_SPCO_Reg_Step { |
15 | 15 | |
16 | 16 | /** |
@@ -135,28 +135,28 @@ discard block |
||
135 | 135 | $registration instanceof EE_Registration |
136 | 136 | && $this->checkout->visit_allows_processing_of_this_registration( $registration ) |
137 | 137 | ) { |
138 | - $subsections[$registration->reg_url_link()] = $this->_registrations_reg_form($registration); |
|
139 | - if ( ! $this->checkout->admin_request) { |
|
140 | - $template_args['registrations'][$registration->reg_url_link()] = $registration; |
|
141 | - $template_args['ticket_count'][$registration->ticket()->ID()] = isset( |
|
142 | - $template_args['ticket_count'][$registration->ticket()->ID()] |
|
143 | - ) |
|
144 | - ? $template_args['ticket_count'][$registration->ticket()->ID()] + 1 |
|
145 | - : 1; |
|
146 | - $ticket_line_item = EEH_Line_Item::get_line_items_by_object_type_and_IDs( |
|
147 | - $this->checkout->cart->get_grand_total(), |
|
148 | - 'Ticket', |
|
149 | - array($registration->ticket()->ID()) |
|
150 | - ); |
|
151 | - $ticket_line_item = is_array($ticket_line_item) |
|
152 | - ? reset($ticket_line_item) |
|
153 | - : $ticket_line_item; |
|
154 | - $template_args['ticket_line_item'][$registration->ticket()->ID()] = |
|
155 | - $Line_Item_Display->display_line_item($ticket_line_item); |
|
156 | - } |
|
157 | - if ($registration->is_primary_registrant()) { |
|
158 | - $primary_registrant = $registration->reg_url_link(); |
|
159 | - } |
|
138 | + $subsections[$registration->reg_url_link()] = $this->_registrations_reg_form($registration); |
|
139 | + if ( ! $this->checkout->admin_request) { |
|
140 | + $template_args['registrations'][$registration->reg_url_link()] = $registration; |
|
141 | + $template_args['ticket_count'][$registration->ticket()->ID()] = isset( |
|
142 | + $template_args['ticket_count'][$registration->ticket()->ID()] |
|
143 | + ) |
|
144 | + ? $template_args['ticket_count'][$registration->ticket()->ID()] + 1 |
|
145 | + : 1; |
|
146 | + $ticket_line_item = EEH_Line_Item::get_line_items_by_object_type_and_IDs( |
|
147 | + $this->checkout->cart->get_grand_total(), |
|
148 | + 'Ticket', |
|
149 | + array($registration->ticket()->ID()) |
|
150 | + ); |
|
151 | + $ticket_line_item = is_array($ticket_line_item) |
|
152 | + ? reset($ticket_line_item) |
|
153 | + : $ticket_line_item; |
|
154 | + $template_args['ticket_line_item'][$registration->ticket()->ID()] = |
|
155 | + $Line_Item_Display->display_line_item($ticket_line_item); |
|
156 | + } |
|
157 | + if ($registration->is_primary_registrant()) { |
|
158 | + $primary_registrant = $registration->reg_url_link(); |
|
159 | + } |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | // print_copy_info ? |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // generate hidden input |
169 | 169 | if ( |
170 | 170 | isset( $subsections[ $primary_registrant ] ) |
171 | - && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper |
|
171 | + && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper |
|
172 | 172 | ) { |
173 | 173 | $subsections[ $primary_registrant ]->add_subsections( $copy_options, 'primary_registrant', false ); |
174 | 174 | } |
@@ -196,42 +196,42 @@ discard block |
||
196 | 196 | |
197 | 197 | |
198 | 198 | |
199 | - /** |
|
199 | + /** |
|
200 | 200 | * @param EE_Registration $registration |
201 | 201 | * @return EE_Form_Section_Base |
202 | 202 | * @throws \EE_Error |
203 | 203 | */ |
204 | 204 | private function _registrations_reg_form( EE_Registration $registration ) { |
205 | 205 | static $attendee_nmbr = 1; |
206 | - $form_args = array(); |
|
206 | + $form_args = array(); |
|
207 | 207 | // verify that registration has valid event |
208 | 208 | if ( $registration->event() instanceof EE_Event ) { |
209 | 209 | $question_groups = $registration->event()->question_groups( |
210 | - array( |
|
211 | - array( |
|
212 | - 'Event.EVT_ID' => $registration->event()->ID(), |
|
213 | - 'Event_Question_Group.EQG_primary' => $registration->count() === 1 ? true : false |
|
214 | - ), |
|
215 | - 'order_by' => array('QSG_order' => 'ASC') |
|
216 | - ) |
|
217 | - ); |
|
210 | + array( |
|
211 | + array( |
|
212 | + 'Event.EVT_ID' => $registration->event()->ID(), |
|
213 | + 'Event_Question_Group.EQG_primary' => $registration->count() === 1 ? true : false |
|
214 | + ), |
|
215 | + 'order_by' => array('QSG_order' => 'ASC') |
|
216 | + ) |
|
217 | + ); |
|
218 | 218 | if ( $question_groups ) { |
219 | - // array of params to pass to parent constructor |
|
220 | - $form_args = array( |
|
221 | - 'html_id' => 'ee-registration-' . $registration->reg_url_link(), |
|
222 | - 'html_class' => 'ee-reg-form-attendee-dv', |
|
223 | - 'html_style' => $this->checkout->admin_request |
|
224 | - ? 'padding:0em 2em 1em; margin:3em 0 0; border:1px solid #ddd;' |
|
225 | - : '', |
|
226 | - 'subsections' => array(), |
|
227 | - 'layout_strategy' => new EE_Fieldset_Section_Layout( |
|
228 | - array( |
|
229 | - 'legend_class' => 'spco-attendee-lgnd smaller-text lt-grey-text', |
|
230 | - 'legend_text' => sprintf(__('Attendee %d', 'event_espresso'), $attendee_nmbr) |
|
231 | - ) |
|
232 | - ) |
|
233 | - ); |
|
234 | - foreach ( $question_groups as $question_group ) { |
|
219 | + // array of params to pass to parent constructor |
|
220 | + $form_args = array( |
|
221 | + 'html_id' => 'ee-registration-' . $registration->reg_url_link(), |
|
222 | + 'html_class' => 'ee-reg-form-attendee-dv', |
|
223 | + 'html_style' => $this->checkout->admin_request |
|
224 | + ? 'padding:0em 2em 1em; margin:3em 0 0; border:1px solid #ddd;' |
|
225 | + : '', |
|
226 | + 'subsections' => array(), |
|
227 | + 'layout_strategy' => new EE_Fieldset_Section_Layout( |
|
228 | + array( |
|
229 | + 'legend_class' => 'spco-attendee-lgnd smaller-text lt-grey-text', |
|
230 | + 'legend_text' => sprintf(__('Attendee %d', 'event_espresso'), $attendee_nmbr) |
|
231 | + ) |
|
232 | + ) |
|
233 | + ); |
|
234 | + foreach ( $question_groups as $question_group ) { |
|
235 | 235 | if ( $question_group instanceof EE_Question_Group ) { |
236 | 236 | $form_args['subsections'][ $question_group->identifier() ] = $this->_question_group_reg_form( |
237 | 237 | $registration, |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | ); |
240 | 240 | } |
241 | 241 | } |
242 | - // add hidden input |
|
243 | - $form_args['subsections']['additional_attendee_reg_info'] = $this->_additional_attendee_reg_info_input( |
|
244 | - $registration |
|
245 | - ); |
|
246 | - // if we have question groups for additional attendees, then display the copy options |
|
242 | + // add hidden input |
|
243 | + $form_args['subsections']['additional_attendee_reg_info'] = $this->_additional_attendee_reg_info_input( |
|
244 | + $registration |
|
245 | + ); |
|
246 | + // if we have question groups for additional attendees, then display the copy options |
|
247 | 247 | $this->_print_copy_info = $attendee_nmbr > 1 ? true : $this->_print_copy_info; |
248 | - if ($registration->is_primary_registrant()) { |
|
249 | - // generate hidden input |
|
250 | - $form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs($registration); |
|
251 | - } |
|
252 | - } |
|
248 | + if ($registration->is_primary_registrant()) { |
|
249 | + // generate hidden input |
|
250 | + $form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs($registration); |
|
251 | + } |
|
252 | + } |
|
253 | 253 | } |
254 | - $attendee_nmbr++; |
|
254 | + $attendee_nmbr++; |
|
255 | 255 | return ! empty($form_args) ? new EE_Form_Section_Proper( $form_args ) : new EE_Form_Section_HTML(); |
256 | 256 | } |
257 | 257 | |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | if ( isset( $valid_data[ $reg_url_link ] ) ) { |
885 | 885 | // do we need to copy basic info from primary attendee ? |
886 | 886 | $copy_primary = isset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) |
887 | - && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0 |
|
887 | + && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0 |
|
888 | 888 | ? true |
889 | 889 | : false; |
890 | 890 | // filter form input data for this registration |
@@ -1059,7 +1059,7 @@ discard block |
||
1059 | 1059 | ? $form_input |
1060 | 1060 | : $form_input . '-' . $registration->reg_url_link(); |
1061 | 1061 | $answer_is_obj = isset( $this->_registration_answers[ $answer_cache_id ] ) |
1062 | - && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer |
|
1062 | + && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer |
|
1063 | 1063 | ? true |
1064 | 1064 | : false; |
1065 | 1065 | //rename form_inputs if they are EE_Attendee properties |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | // then attempt to copy them from the primary attendee |
1180 | 1180 | if ( |
1181 | 1181 | $this->checkout->primary_attendee_obj instanceof EE_Attendee |
1182 | - && ! isset( $attendee_data['ATT_fname'], $attendee_data['ATT_email'] ) |
|
1182 | + && ! isset( $attendee_data['ATT_fname'], $attendee_data['ATT_email'] ) |
|
1183 | 1183 | ) { |
1184 | 1184 | return $this->checkout->primary_attendee_obj; |
1185 | 1185 | } |
@@ -1297,7 +1297,7 @@ discard block |
||
1297 | 1297 | } |
1298 | 1298 | foreach ( $critical_attendee_details as $critical_attendee_detail ) { |
1299 | 1299 | if ( ! isset( $attendee_data[ $critical_attendee_detail ] ) |
1300 | - || empty( $attendee_data[ $critical_attendee_detail ] ) |
|
1300 | + || empty( $attendee_data[ $critical_attendee_detail ] ) |
|
1301 | 1301 | ) { |
1302 | 1302 | $attendee_data[ $critical_attendee_detail ] = $this->checkout->primary_attendee_obj->get( |
1303 | 1303 | $critical_attendee_detail |
@@ -41,21 +41,21 @@ discard block |
||
41 | 41 | * @access public |
42 | 42 | * @param EE_Checkout $checkout |
43 | 43 | */ |
44 | - public function __construct( EE_Checkout $checkout ) { |
|
44 | + public function __construct(EE_Checkout $checkout) { |
|
45 | 45 | $this->_slug = 'attendee_information'; |
46 | 46 | $this->_name = __('Attendee Information', 'event_espresso'); |
47 | - $this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_main.template.php'; |
|
47 | + $this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_main.template.php'; |
|
48 | 48 | $this->checkout = $checkout; |
49 | 49 | $this->_reset_success_message(); |
50 | 50 | $this->set_instructions( |
51 | - __( 'Please answer the following registration questions before proceeding.', 'event_espresso' ) |
|
51 | + __('Please answer the following registration questions before proceeding.', 'event_espresso') |
|
52 | 52 | ); |
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | |
57 | 57 | public function translate_js_strings() { |
58 | - EE_Registry::$i18n_js_strings['required_field'] = __( ' is a required question.', 'event_espresso' ); |
|
58 | + EE_Registry::$i18n_js_strings['required_field'] = __(' is a required question.', 'event_espresso'); |
|
59 | 59 | EE_Registry::$i18n_js_strings['required_multi_field'] = __( |
60 | 60 | ' is a required question. Please enter a value for at least one of the options.', |
61 | 61 | 'event_espresso' |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | // calculate taxes |
116 | 116 | $Line_Item_Display->display_line_item( |
117 | 117 | $this->checkout->cart->get_grand_total(), |
118 | - array( 'set_tax_rate' => true ) |
|
118 | + array('set_tax_rate' => true) |
|
119 | 119 | ); |
120 | 120 | /** @var $subsections EE_Form_Section_Proper[] */ |
121 | 121 | $subsections = array( |
@@ -127,13 +127,13 @@ discard block |
||
127 | 127 | 'ticket_count' => array() |
128 | 128 | ); |
129 | 129 | // grab the saved registrations from the transaction |
130 | - $registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ); |
|
131 | - if ( $registrations ) { |
|
132 | - foreach ( $registrations as $registration ) { |
|
130 | + $registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params); |
|
131 | + if ($registrations) { |
|
132 | + foreach ($registrations as $registration) { |
|
133 | 133 | // can this registration be processed during this visit ? |
134 | 134 | if ( |
135 | 135 | $registration instanceof EE_Registration |
136 | - && $this->checkout->visit_allows_processing_of_this_registration( $registration ) |
|
136 | + && $this->checkout->visit_allows_processing_of_this_registration($registration) |
|
137 | 137 | ) { |
138 | 138 | $subsections[$registration->reg_url_link()] = $this->_registrations_reg_form($registration); |
139 | 139 | if ( ! $this->checkout->admin_request) { |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | } |
161 | 161 | } |
162 | 162 | // print_copy_info ? |
163 | - if ( $primary_registrant && ! $this->checkout->admin_request && count( $registrations ) > 1 ) { |
|
163 | + if ($primary_registrant && ! $this->checkout->admin_request && count($registrations) > 1) { |
|
164 | 164 | // TODO: add admin option for toggling copy attendee info, then use that value to change $this->_print_copy_info |
165 | 165 | $copy_options['spco_copy_attendee_chk'] = $this->_print_copy_info |
166 | 166 | ? $this->_copy_attendee_info_form() |
167 | 167 | : $this->_auto_copy_attendee_info(); |
168 | 168 | // generate hidden input |
169 | 169 | if ( |
170 | - isset( $subsections[ $primary_registrant ] ) |
|
171 | - && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper |
|
170 | + isset($subsections[$primary_registrant]) |
|
171 | + && $subsections[$primary_registrant] instanceof EE_Form_Section_Proper |
|
172 | 172 | ) { |
173 | - $subsections[ $primary_registrant ]->add_subsections( $copy_options, 'primary_registrant', false ); |
|
173 | + $subsections[$primary_registrant]->add_subsections($copy_options, 'primary_registrant', false); |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
@@ -182,8 +182,7 @@ discard block |
||
182 | 182 | 'html_id' => $this->reg_form_name(), |
183 | 183 | 'subsections' => $subsections, |
184 | 184 | 'layout_strategy' => $this->checkout->admin_request ? |
185 | - new EE_Div_Per_Section_Layout() : |
|
186 | - new EE_Template_Layout( |
|
185 | + new EE_Div_Per_Section_Layout() : new EE_Template_Layout( |
|
187 | 186 | array( |
188 | 187 | 'layout_template_file' => $this->_template, // layout_template |
189 | 188 | 'template_args' => $template_args |
@@ -201,11 +200,11 @@ discard block |
||
201 | 200 | * @return EE_Form_Section_Base |
202 | 201 | * @throws \EE_Error |
203 | 202 | */ |
204 | - private function _registrations_reg_form( EE_Registration $registration ) { |
|
203 | + private function _registrations_reg_form(EE_Registration $registration) { |
|
205 | 204 | static $attendee_nmbr = 1; |
206 | 205 | $form_args = array(); |
207 | 206 | // verify that registration has valid event |
208 | - if ( $registration->event() instanceof EE_Event ) { |
|
207 | + if ($registration->event() instanceof EE_Event) { |
|
209 | 208 | $question_groups = $registration->event()->question_groups( |
210 | 209 | array( |
211 | 210 | array( |
@@ -215,10 +214,10 @@ discard block |
||
215 | 214 | 'order_by' => array('QSG_order' => 'ASC') |
216 | 215 | ) |
217 | 216 | ); |
218 | - if ( $question_groups ) { |
|
217 | + if ($question_groups) { |
|
219 | 218 | // array of params to pass to parent constructor |
220 | 219 | $form_args = array( |
221 | - 'html_id' => 'ee-registration-' . $registration->reg_url_link(), |
|
220 | + 'html_id' => 'ee-registration-'.$registration->reg_url_link(), |
|
222 | 221 | 'html_class' => 'ee-reg-form-attendee-dv', |
223 | 222 | 'html_style' => $this->checkout->admin_request |
224 | 223 | ? 'padding:0em 2em 1em; margin:3em 0 0; border:1px solid #ddd;' |
@@ -231,9 +230,9 @@ discard block |
||
231 | 230 | ) |
232 | 231 | ) |
233 | 232 | ); |
234 | - foreach ( $question_groups as $question_group ) { |
|
235 | - if ( $question_group instanceof EE_Question_Group ) { |
|
236 | - $form_args['subsections'][ $question_group->identifier() ] = $this->_question_group_reg_form( |
|
233 | + foreach ($question_groups as $question_group) { |
|
234 | + if ($question_group instanceof EE_Question_Group) { |
|
235 | + $form_args['subsections'][$question_group->identifier()] = $this->_question_group_reg_form( |
|
237 | 236 | $registration, |
238 | 237 | $question_group |
239 | 238 | ); |
@@ -252,7 +251,7 @@ discard block |
||
252 | 251 | } |
253 | 252 | } |
254 | 253 | $attendee_nmbr++; |
255 | - return ! empty($form_args) ? new EE_Form_Section_Proper( $form_args ) : new EE_Form_Section_HTML(); |
|
254 | + return ! empty($form_args) ? new EE_Form_Section_Proper($form_args) : new EE_Form_Section_HTML(); |
|
256 | 255 | } |
257 | 256 | |
258 | 257 | |
@@ -273,7 +272,7 @@ discard block |
||
273 | 272 | // generate hidden input |
274 | 273 | return new EE_Hidden_Input( |
275 | 274 | array( |
276 | - 'html_id' => 'additional-attendee-reg-info-' . $registration->reg_url_link(), |
|
275 | + 'html_id' => 'additional-attendee-reg-info-'.$registration->reg_url_link(), |
|
277 | 276 | 'default' => $additional_attendee_reg_info |
278 | 277 | ) |
279 | 278 | ); |
@@ -287,26 +286,26 @@ discard block |
||
287 | 286 | * @return EE_Form_Section_Proper |
288 | 287 | * @throws \EE_Error |
289 | 288 | */ |
290 | - private function _question_group_reg_form( EE_Registration $registration, EE_Question_Group $question_group ){ |
|
289 | + private function _question_group_reg_form(EE_Registration $registration, EE_Question_Group $question_group) { |
|
291 | 290 | // array of params to pass to parent constructor |
292 | 291 | $form_args = array( |
293 | - 'html_id' => 'ee-reg-form-qstn-grp-' . $question_group->identifier(), |
|
292 | + 'html_id' => 'ee-reg-form-qstn-grp-'.$question_group->identifier(), |
|
294 | 293 | 'html_class' => $this->checkout->admin_request |
295 | 294 | ? 'form-table ee-reg-form-qstn-grp-dv' |
296 | 295 | : 'ee-reg-form-qstn-grp-dv', |
297 | - 'html_label_id' => 'ee-reg-form-qstn-grp-' . $question_group->identifier() . '-lbl', |
|
296 | + 'html_label_id' => 'ee-reg-form-qstn-grp-'.$question_group->identifier().'-lbl', |
|
298 | 297 | 'subsections' => array( |
299 | - 'reg_form_qstn_grp_hdr' => $this->_question_group_header( $question_group ) |
|
298 | + 'reg_form_qstn_grp_hdr' => $this->_question_group_header($question_group) |
|
300 | 299 | ), |
301 | 300 | 'layout_strategy' => $this->checkout->admin_request |
302 | 301 | ? new EE_Admin_Two_Column_Layout() |
303 | 302 | : new EE_Div_Per_Section_Layout() |
304 | 303 | ); |
305 | 304 | // where params |
306 | - $query_params = array( 'QST_deleted' => 0 ); |
|
305 | + $query_params = array('QST_deleted' => 0); |
|
307 | 306 | // don't load admin only questions on the frontend |
308 | - if ( ! $this->checkout->admin_request ) { |
|
309 | - $query_params['QST_admin_only'] = array( '!=', true ); |
|
307 | + if ( ! $this->checkout->admin_request) { |
|
308 | + $query_params['QST_admin_only'] = array('!=', true); |
|
310 | 309 | } |
311 | 310 | $questions = $question_group->get_many_related( |
312 | 311 | 'Question', |
@@ -328,10 +327,10 @@ discard block |
||
328 | 327 | ) |
329 | 328 | ); |
330 | 329 | // loop thru questions |
331 | - foreach ( $questions as $question ) { |
|
332 | - if( $question instanceof EE_Question ){ |
|
330 | + foreach ($questions as $question) { |
|
331 | + if ($question instanceof EE_Question) { |
|
333 | 332 | $identifier = $question->is_system_question() ? $question->system_ID() : $question->ID(); |
334 | - $form_args['subsections'][ $identifier ] = $this->reg_form_question( $registration, $question ); |
|
333 | + $form_args['subsections'][$identifier] = $this->reg_form_question($registration, $question); |
|
335 | 334 | } |
336 | 335 | } |
337 | 336 | $form_args['subsections'] = apply_filters( |
@@ -352,7 +351,7 @@ discard block |
||
352 | 351 | ) |
353 | 352 | ); |
354 | 353 | // d( $form_args ); |
355 | - $question_group_reg_form = new EE_Form_Section_Proper( $form_args ); |
|
354 | + $question_group_reg_form = new EE_Form_Section_Proper($form_args); |
|
356 | 355 | return apply_filters( |
357 | 356 | 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', |
358 | 357 | $question_group_reg_form, |
@@ -369,11 +368,11 @@ discard block |
||
369 | 368 | * @param EE_Question_Group $question_group |
370 | 369 | * @return EE_Form_Section_HTML |
371 | 370 | */ |
372 | - private function _question_group_header( EE_Question_Group $question_group ){ |
|
371 | + private function _question_group_header(EE_Question_Group $question_group) { |
|
373 | 372 | $html = ''; |
374 | 373 | // group_name |
375 | - if ( $question_group->show_group_name() && $question_group->name() !== '' ) { |
|
376 | - if ( $this->checkout->admin_request ) { |
|
374 | + if ($question_group->show_group_name() && $question_group->name() !== '') { |
|
375 | + if ($this->checkout->admin_request) { |
|
377 | 376 | $html .= EEH_HTML::br(); |
378 | 377 | $html .= EEH_HTML::h3( |
379 | 378 | $question_group->name(), |
@@ -387,7 +386,7 @@ discard block |
||
387 | 386 | } |
388 | 387 | } |
389 | 388 | // group_desc |
390 | - if ( $question_group->show_group_desc() && $question_group->desc() !== '' ) { |
|
389 | + if ($question_group->show_group_desc() && $question_group->desc() !== '') { |
|
391 | 390 | $html .= EEH_HTML::p( |
392 | 391 | $question_group->desc(), |
393 | 392 | '', |
@@ -397,7 +396,7 @@ discard block |
||
397 | 396 | ); |
398 | 397 | |
399 | 398 | } |
400 | - return new EE_Form_Section_HTML( $html ); |
|
399 | + return new EE_Form_Section_HTML($html); |
|
401 | 400 | } |
402 | 401 | |
403 | 402 | |
@@ -407,7 +406,7 @@ discard block |
||
407 | 406 | * @return EE_Form_Section_Proper |
408 | 407 | * @throws \EE_Error |
409 | 408 | */ |
410 | - private function _copy_attendee_info_form(){ |
|
409 | + private function _copy_attendee_info_form() { |
|
411 | 410 | // array of params to pass to parent constructor |
412 | 411 | return new EE_Form_Section_Proper( |
413 | 412 | array( |
@@ -436,7 +435,7 @@ discard block |
||
436 | 435 | private function _auto_copy_attendee_info() { |
437 | 436 | return new EE_Form_Section_HTML( |
438 | 437 | EEH_Template::locate_template( |
439 | - SPCO_REG_STEPS_PATH . $this->_slug . DS . '_auto_copy_attendee_info.template.php', |
|
438 | + SPCO_REG_STEPS_PATH.$this->_slug.DS.'_auto_copy_attendee_info.template.php', |
|
440 | 439 | apply_filters( |
441 | 440 | 'FHEE__EE_SPCO_Reg_Step_Attendee_Information__auto_copy_attendee_info__template_args', |
442 | 441 | array() |
@@ -460,32 +459,32 @@ discard block |
||
460 | 459 | $copy_attendee_info_inputs = array(); |
461 | 460 | $prev_ticket = NULL; |
462 | 461 | // grab the saved registrations from the transaction |
463 | - $registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ); |
|
464 | - foreach ( $registrations as $registration ) { |
|
462 | + $registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params); |
|
463 | + foreach ($registrations as $registration) { |
|
465 | 464 | // for all attendees other than the primary attendee |
466 | - if ( $registration instanceof EE_Registration && ! $registration->is_primary_registrant() ) { |
|
465 | + if ($registration instanceof EE_Registration && ! $registration->is_primary_registrant()) { |
|
467 | 466 | // if this is a new ticket OR if this is the very first additional attendee after the primary attendee |
468 | - if ( $registration->ticket()->ID() !== $prev_ticket ) { |
|
467 | + if ($registration->ticket()->ID() !== $prev_ticket) { |
|
469 | 468 | $item_name = $registration->ticket()->name(); |
470 | 469 | $item_name .= $registration->ticket()->description() !== '' |
471 | - ? ' - ' . $registration->ticket()->description() |
|
470 | + ? ' - '.$registration->ticket()->description() |
|
472 | 471 | : ''; |
473 | - $copy_attendee_info_inputs[ 'spco_copy_attendee_chk[ticket-' . $registration->ticket()->ID() . ']' ] = new EE_Form_Section_HTML( |
|
474 | - '<h6 class="spco-copy-attendee-event-hdr">' . $item_name . '</h6>' |
|
472 | + $copy_attendee_info_inputs['spco_copy_attendee_chk[ticket-'.$registration->ticket()->ID().']'] = new EE_Form_Section_HTML( |
|
473 | + '<h6 class="spco-copy-attendee-event-hdr">'.$item_name.'</h6>' |
|
475 | 474 | ); |
476 | 475 | $prev_ticket = $registration->ticket()->ID(); |
477 | 476 | } |
478 | 477 | |
479 | - $copy_attendee_info_inputs[ 'spco_copy_attendee_chk[' . $registration->ID() . ']' ] = new |
|
478 | + $copy_attendee_info_inputs['spco_copy_attendee_chk['.$registration->ID().']'] = new |
|
480 | 479 | EE_Checkbox_Multi_Input( |
481 | 480 | array( |
482 | 481 | $registration->ID() => sprintf( |
483 | - __( 'Attendee #%s', 'event_espresso' ), |
|
482 | + __('Attendee #%s', 'event_espresso'), |
|
484 | 483 | $registration->count() |
485 | 484 | ) |
486 | 485 | ), |
487 | 486 | array( |
488 | - 'html_id' => 'spco-copy-attendee-chk-' . $registration->reg_url_link(), |
|
487 | + 'html_id' => 'spco-copy-attendee-chk-'.$registration->reg_url_link(), |
|
489 | 488 | 'html_class' => 'spco-copy-attendee-chk ee-do-not-validate', |
490 | 489 | 'display_html_label_text' => false |
491 | 490 | ) |
@@ -505,7 +504,7 @@ discard block |
||
505 | 504 | * @return EE_Form_Input_Base |
506 | 505 | * @throws \EE_Error |
507 | 506 | */ |
508 | - private function _additional_primary_registrant_inputs( EE_Registration $registration ){ |
|
507 | + private function _additional_primary_registrant_inputs(EE_Registration $registration) { |
|
509 | 508 | // generate hidden input |
510 | 509 | return new EE_Hidden_Input( |
511 | 510 | array( |
@@ -524,7 +523,7 @@ discard block |
||
524 | 523 | * @return EE_Form_Input_Base |
525 | 524 | * @throws \EE_Error |
526 | 525 | */ |
527 | - public function reg_form_question( EE_Registration $registration, EE_Question $question ){ |
|
526 | + public function reg_form_question(EE_Registration $registration, EE_Question $question) { |
|
528 | 527 | |
529 | 528 | // if this question was for an attendee detail, then check for that answer |
530 | 529 | $answer_value = EEM_Answer::instance()->get_attendee_property_answer_value( |
@@ -533,32 +532,32 @@ discard block |
||
533 | 532 | ); |
534 | 533 | $answer = $answer_value === null |
535 | 534 | ? EEM_Answer::instance()->get_one( |
536 | - array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) ) |
|
535 | + array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID())) |
|
537 | 536 | ) |
538 | 537 | : null; |
539 | 538 | // if NOT returning to edit an existing registration |
540 | 539 | // OR if this question is for an attendee property |
541 | 540 | // OR we still don't have an EE_Answer object |
542 | - if( $answer_value || ! $answer instanceof EE_Answer || ! $registration->reg_url_link() ) { |
|
541 | + if ($answer_value || ! $answer instanceof EE_Answer || ! $registration->reg_url_link()) { |
|
543 | 542 | // create an EE_Answer object for storing everything in |
544 | - $answer = EE_Answer::new_instance ( array( |
|
543 | + $answer = EE_Answer::new_instance(array( |
|
545 | 544 | 'QST_ID'=> $question->ID(), |
546 | 545 | 'REG_ID'=> $registration->ID() |
547 | 546 | )); |
548 | 547 | } |
549 | 548 | // verify instance |
550 | - if( $answer instanceof EE_Answer ){ |
|
551 | - if ( ! empty( $answer_value )) { |
|
552 | - $answer->set( 'ANS_value', $answer_value ); |
|
549 | + if ($answer instanceof EE_Answer) { |
|
550 | + if ( ! empty($answer_value)) { |
|
551 | + $answer->set('ANS_value', $answer_value); |
|
553 | 552 | } |
554 | - $answer->cache( 'Question', $question ); |
|
553 | + $answer->cache('Question', $question); |
|
555 | 554 | //remember system ID had a bug where sometimes it could be null |
556 | - $answer_cache_id =$question->is_system_question() |
|
557 | - ? $question->system_ID() . '-' . $registration->reg_url_link() |
|
558 | - : $question->ID() . '-' . $registration->reg_url_link(); |
|
559 | - $registration->cache( 'Answer', $answer, $answer_cache_id ); |
|
555 | + $answer_cache_id = $question->is_system_question() |
|
556 | + ? $question->system_ID().'-'.$registration->reg_url_link() |
|
557 | + : $question->ID().'-'.$registration->reg_url_link(); |
|
558 | + $registration->cache('Answer', $answer, $answer_cache_id); |
|
560 | 559 | } |
561 | - return $this->_generate_question_input( $registration, $question, $answer ); |
|
560 | + return $this->_generate_question_input($registration, $question, $answer); |
|
562 | 561 | |
563 | 562 | } |
564 | 563 | |
@@ -571,46 +570,46 @@ discard block |
||
571 | 570 | * @return EE_Form_Input_Base |
572 | 571 | * @throws \EE_Error |
573 | 572 | */ |
574 | - private function _generate_question_input( EE_Registration $registration, EE_Question $question, $answer ){ |
|
573 | + private function _generate_question_input(EE_Registration $registration, EE_Question $question, $answer) { |
|
575 | 574 | $identifier = $question->is_system_question() ? $question->system_ID() : $question->ID(); |
576 | - $this->_required_questions[ $identifier ] = $question->required() ? true : false; |
|
575 | + $this->_required_questions[$identifier] = $question->required() ? true : false; |
|
577 | 576 | add_filter( |
578 | 577 | 'FHEE__EE_Question__generate_form_input__country_options', |
579 | - array( $this, 'use_cached_countries_for_form_input' ), |
|
578 | + array($this, 'use_cached_countries_for_form_input'), |
|
580 | 579 | 10, |
581 | 580 | 4 |
582 | 581 | ); |
583 | 582 | add_filter( |
584 | 583 | 'FHEE__EE_Question__generate_form_input__state_options', |
585 | - array( $this, 'use_cached_states_for_form_input' ), |
|
584 | + array($this, 'use_cached_states_for_form_input'), |
|
586 | 585 | 10, |
587 | 586 | 4 |
588 | 587 | ); |
589 | 588 | $input_constructor_args = array( |
590 | - 'html_name' => 'ee_reg_qstn[' . $registration->ID() . '][' . $identifier . ']', |
|
591 | - 'html_id' => 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier, |
|
592 | - 'html_class' => 'ee-reg-qstn ee-reg-qstn-' . $identifier, |
|
593 | - 'html_label_id' => 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier, |
|
589 | + 'html_name' => 'ee_reg_qstn['.$registration->ID().']['.$identifier.']', |
|
590 | + 'html_id' => 'ee_reg_qstn-'.$registration->ID().'-'.$identifier, |
|
591 | + 'html_class' => 'ee-reg-qstn ee-reg-qstn-'.$identifier, |
|
592 | + 'html_label_id' => 'ee_reg_qstn-'.$registration->ID().'-'.$identifier, |
|
594 | 593 | 'html_label_class' => 'ee-reg-qstn', |
595 | 594 | ); |
596 | - $input_constructor_args['html_label_id'] .= '-lbl'; |
|
597 | - if ( $answer instanceof EE_Answer && $answer->ID() ) { |
|
598 | - $input_constructor_args[ 'html_name' ] .= '[' . $answer->ID() . ']'; |
|
599 | - $input_constructor_args[ 'html_id' ] .= '-' . $answer->ID(); |
|
600 | - $input_constructor_args[ 'html_label_id' ] .= '-' . $answer->ID(); |
|
595 | + $input_constructor_args['html_label_id'] .= '-lbl'; |
|
596 | + if ($answer instanceof EE_Answer && $answer->ID()) { |
|
597 | + $input_constructor_args['html_name'] .= '['.$answer->ID().']'; |
|
598 | + $input_constructor_args['html_id'] .= '-'.$answer->ID(); |
|
599 | + $input_constructor_args['html_label_id'] .= '-'.$answer->ID(); |
|
601 | 600 | } |
602 | - $form_input = $question->generate_form_input( |
|
601 | + $form_input = $question->generate_form_input( |
|
603 | 602 | $registration, |
604 | 603 | $answer, |
605 | 604 | $input_constructor_args |
606 | 605 | ); |
607 | 606 | remove_filter( |
608 | 607 | 'FHEE__EE_Question__generate_form_input__country_options', |
609 | - array( $this, 'use_cached_countries_for_form_input' ) |
|
608 | + array($this, 'use_cached_countries_for_form_input') |
|
610 | 609 | ); |
611 | 610 | remove_filter( |
612 | 611 | 'FHEE__EE_Question__generate_form_input__state_options', |
613 | - array( $this, 'use_cached_states_for_form_input' ) |
|
612 | + array($this, 'use_cached_states_for_form_input') |
|
614 | 613 | ); |
615 | 614 | return $form_input; |
616 | 615 | } |
@@ -632,22 +631,22 @@ discard block |
||
632 | 631 | \EE_Registration $registration = null, |
633 | 632 | \EE_Answer $answer = null |
634 | 633 | ) { |
635 | - $country_options = array( '' => '' ); |
|
634 | + $country_options = array('' => ''); |
|
636 | 635 | // get possibly cached list of countries |
637 | 636 | $countries = $this->checkout->action === 'process_reg_step' |
638 | 637 | ? EEM_Country::instance()->get_all_countries() |
639 | 638 | : EEM_Country::instance()->get_all_active_countries(); |
640 | - if ( ! empty( $countries )) { |
|
641 | - foreach( $countries as $country ){ |
|
642 | - if ( $country instanceof EE_Country ) { |
|
643 | - $country_options[ $country->ID() ] = $country->name(); |
|
639 | + if ( ! empty($countries)) { |
|
640 | + foreach ($countries as $country) { |
|
641 | + if ($country instanceof EE_Country) { |
|
642 | + $country_options[$country->ID()] = $country->name(); |
|
644 | 643 | } |
645 | 644 | } |
646 | 645 | } |
647 | - if( $question instanceof EE_Question |
|
648 | - && $registration instanceof EE_Registration ) { |
|
646 | + if ($question instanceof EE_Question |
|
647 | + && $registration instanceof EE_Registration) { |
|
649 | 648 | $answer = EEM_Answer::instance()->get_one( |
650 | - array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) ) |
|
649 | + array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID())) |
|
651 | 650 | ); |
652 | 651 | } else { |
653 | 652 | $answer = EE_Answer::new_instance(); |
@@ -680,14 +679,14 @@ discard block |
||
680 | 679 | \EE_Registration $registration = null, |
681 | 680 | \EE_Answer $answer = null |
682 | 681 | ) { |
683 | - $state_options = array( '' => array( '' => '')); |
|
682 | + $state_options = array('' => array('' => '')); |
|
684 | 683 | $states = $this->checkout->action === 'process_reg_step' |
685 | 684 | ? EEM_State::instance()->get_all_states() |
686 | 685 | : EEM_State::instance()->get_all_active_states(); |
687 | - if ( ! empty( $states )) { |
|
688 | - foreach( $states as $state ){ |
|
689 | - if ( $state instanceof EE_State ) { |
|
690 | - $state_options[ $state->country()->name() ][ $state->ID() ] = $state->name(); |
|
686 | + if ( ! empty($states)) { |
|
687 | + foreach ($states as $state) { |
|
688 | + if ($state instanceof EE_State) { |
|
689 | + $state_options[$state->country()->name()][$state->ID()] = $state->name(); |
|
691 | 690 | } |
692 | 691 | } |
693 | 692 | } |
@@ -715,24 +714,24 @@ discard block |
||
715 | 714 | * @throws \EE_Error |
716 | 715 | */ |
717 | 716 | public function process_reg_step() { |
718 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
717 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
719 | 718 | // grab validated data from form |
720 | 719 | $valid_data = $this->checkout->current_step->valid_data(); |
721 | 720 | // EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ ); |
722 | 721 | // EEH_Debug_Tools::printr( $valid_data, '$valid_data', __FILE__, __LINE__ ); |
723 | 722 | // if we don't have any $valid_data then something went TERRIBLY WRONG !!! |
724 | - if ( empty( $valid_data )) { |
|
723 | + if (empty($valid_data)) { |
|
725 | 724 | EE_Error::add_error( |
726 | - __( 'No valid question responses were received.', 'event_espresso' ), |
|
725 | + __('No valid question responses were received.', 'event_espresso'), |
|
727 | 726 | __FILE__, |
728 | 727 | __FUNCTION__, |
729 | 728 | __LINE__ |
730 | 729 | ); |
731 | 730 | return false; |
732 | 731 | } |
733 | - if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg ) { |
|
732 | + if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg) { |
|
734 | 733 | EE_Error::add_error( |
735 | - __( 'A valid transaction could not be initiated for processing your registrations.', 'event_espresso' ), |
|
734 | + __('A valid transaction could not be initiated for processing your registrations.', 'event_espresso'), |
|
736 | 735 | __FILE__, |
737 | 736 | __FUNCTION__, |
738 | 737 | __LINE__ |
@@ -740,11 +739,11 @@ discard block |
||
740 | 739 | return false; |
741 | 740 | } |
742 | 741 | // get cached registrations |
743 | - $registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ); |
|
742 | + $registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params); |
|
744 | 743 | // verify we got the goods |
745 | - if ( empty( $registrations )) { |
|
744 | + if (empty($registrations)) { |
|
746 | 745 | EE_Error::add_error( |
747 | - __( 'Your form data could not be applied to any valid registrations.', 'event_espresso' ), |
|
746 | + __('Your form data could not be applied to any valid registrations.', 'event_espresso'), |
|
748 | 747 | __FILE__, |
749 | 748 | __FUNCTION__, |
750 | 749 | __LINE__ |
@@ -752,15 +751,15 @@ discard block |
||
752 | 751 | return false; |
753 | 752 | } |
754 | 753 | // extract attendee info from form data and save to model objects |
755 | - $registrations_processed = $this->_process_registrations( $registrations, $valid_data ); |
|
754 | + $registrations_processed = $this->_process_registrations($registrations, $valid_data); |
|
756 | 755 | // if first pass thru SPCO, |
757 | 756 | // then let's check processed registrations against the total number of tickets in the cart |
758 | - if ( $registrations_processed === false ) { |
|
757 | + if ($registrations_processed === false) { |
|
759 | 758 | // but return immediately if the previous step exited early due to errors |
760 | 759 | return false; |
761 | - } else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count ) { |
|
760 | + } else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count) { |
|
762 | 761 | // generate a correctly translated string for all possible singular/plural combinations |
763 | - if ( $this->checkout->total_ticket_count === 1 && $registrations_processed !== 1 ) { |
|
762 | + if ($this->checkout->total_ticket_count === 1 && $registrations_processed !== 1) { |
|
764 | 763 | $error_msg = sprintf( |
765 | 764 | __( |
766 | 765 | 'There was %1$d ticket in the Event Queue, but %2$ds registrations were processed', |
@@ -769,7 +768,7 @@ discard block |
||
769 | 768 | $this->checkout->total_ticket_count, |
770 | 769 | $registrations_processed |
771 | 770 | ); |
772 | - } else if ( $this->checkout->total_ticket_count !== 1 && $registrations_processed === 1 ) { |
|
771 | + } else if ($this->checkout->total_ticket_count !== 1 && $registrations_processed === 1) { |
|
773 | 772 | $error_msg = sprintf( |
774 | 773 | __( |
775 | 774 | 'There was a total of %1$d tickets in the Event Queue, but only %2$ds registration was processed', |
@@ -788,17 +787,17 @@ discard block |
||
788 | 787 | $registrations_processed |
789 | 788 | ); |
790 | 789 | } |
791 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
790 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
792 | 791 | return false; |
793 | 792 | } |
794 | 793 | // mark this reg step as completed |
795 | 794 | $this->set_completed(); |
796 | 795 | $this->_set_success_message( |
797 | - __( 'The Attendee Information Step has been successfully completed.', 'event_espresso' ) |
|
796 | + __('The Attendee Information Step has been successfully completed.', 'event_espresso') |
|
798 | 797 | ); |
799 | 798 | //do action in case a plugin wants to do something with the data submitted in step 1. |
800 | 799 | //passes EE_Single_Page_Checkout, and it's posted data |
801 | - do_action( 'AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data ); |
|
800 | + do_action('AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data); |
|
802 | 801 | return true; |
803 | 802 | } |
804 | 803 | |
@@ -812,9 +811,9 @@ discard block |
||
812 | 811 | * @return boolean | int |
813 | 812 | * @throws \EE_Error |
814 | 813 | */ |
815 | - private function _process_registrations( $registrations = array(), $valid_data = array() ) { |
|
814 | + private function _process_registrations($registrations = array(), $valid_data = array()) { |
|
816 | 815 | // load resources and set some defaults |
817 | - EE_Registry::instance()->load_model( 'Attendee' ); |
|
816 | + EE_Registry::instance()->load_model('Attendee'); |
|
818 | 817 | // holder for primary registrant attendee object |
819 | 818 | $this->checkout->primary_attendee_obj = NULL; |
820 | 819 | // array for tracking reg form data for the primary registrant |
@@ -831,9 +830,9 @@ discard block |
||
831 | 830 | // attendee counter |
832 | 831 | $att_nmbr = 0; |
833 | 832 | // grab the saved registrations from the transaction |
834 | - foreach ( $registrations as $registration ) { |
|
833 | + foreach ($registrations as $registration) { |
|
835 | 834 | // verify EE_Registration object |
836 | - if ( ! $registration instanceof EE_Registration ) { |
|
835 | + if ( ! $registration instanceof EE_Registration) { |
|
837 | 836 | EE_Error::add_error( |
838 | 837 | __( |
839 | 838 | 'An invalid Registration object was discovered when attempting to process your registration information.', |
@@ -848,12 +847,12 @@ discard block |
||
848 | 847 | /** @var string $reg_url_link */ |
849 | 848 | $reg_url_link = $registration->reg_url_link(); |
850 | 849 | // reg_url_link exists ? |
851 | - if ( ! empty( $reg_url_link ) ) { |
|
850 | + if ( ! empty($reg_url_link)) { |
|
852 | 851 | // should this registration be processed during this visit ? |
853 | - if ( $this->checkout->visit_allows_processing_of_this_registration( $registration ) ) { |
|
852 | + if ($this->checkout->visit_allows_processing_of_this_registration($registration)) { |
|
854 | 853 | // if NOT revisiting, then let's save the registration now, |
855 | 854 | // so that we have a REG_ID to use when generating other objects |
856 | - if ( ! $this->checkout->revisit ) { |
|
855 | + if ( ! $this->checkout->revisit) { |
|
857 | 856 | $registration->save(); |
858 | 857 | } |
859 | 858 | /** |
@@ -863,7 +862,7 @@ discard block |
||
863 | 862 | * @var bool if true is returned by the plugin then the |
864 | 863 | * registration processing is halted. |
865 | 864 | */ |
866 | - if ( apply_filters( |
|
865 | + if (apply_filters( |
|
867 | 866 | 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___process_registrations__pre_registration_process', |
868 | 867 | false, |
869 | 868 | $att_nmbr, |
@@ -871,38 +870,38 @@ discard block |
||
871 | 870 | $registrations, |
872 | 871 | $valid_data, |
873 | 872 | $this |
874 | - ) ) { |
|
873 | + )) { |
|
875 | 874 | return false; |
876 | 875 | } |
877 | 876 | |
878 | 877 | // Houston, we have a registration! |
879 | 878 | $att_nmbr++; |
880 | - $this->_attendee_data[ $reg_url_link ] = array(); |
|
879 | + $this->_attendee_data[$reg_url_link] = array(); |
|
881 | 880 | // grab any existing related answer objects |
882 | 881 | $this->_registration_answers = $registration->answers(); |
883 | 882 | // unset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ); |
884 | - if ( isset( $valid_data[ $reg_url_link ] ) ) { |
|
883 | + if (isset($valid_data[$reg_url_link])) { |
|
885 | 884 | // do we need to copy basic info from primary attendee ? |
886 | - $copy_primary = isset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) |
|
887 | - && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0 |
|
885 | + $copy_primary = isset($valid_data[$reg_url_link]['additional_attendee_reg_info']) |
|
886 | + && absint($valid_data[$reg_url_link]['additional_attendee_reg_info']) === 0 |
|
888 | 887 | ? true |
889 | 888 | : false; |
890 | 889 | // filter form input data for this registration |
891 | - $valid_data[ $reg_url_link ] = (array)apply_filters( |
|
890 | + $valid_data[$reg_url_link] = (array) apply_filters( |
|
892 | 891 | 'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', |
893 | - $valid_data[ $reg_url_link ] |
|
892 | + $valid_data[$reg_url_link] |
|
894 | 893 | ); |
895 | 894 | // EEH_Debug_Tools::printr( $valid_data[ $reg_url_link ], '$valid_data[ $reg_url_link ]', __FILE__, __LINE__ ); |
896 | - if ( isset( $valid_data['primary_attendee'] )) { |
|
897 | - $primary_registrant['line_item_id'] = ! empty( $valid_data['primary_attendee'] ) |
|
895 | + if (isset($valid_data['primary_attendee'])) { |
|
896 | + $primary_registrant['line_item_id'] = ! empty($valid_data['primary_attendee']) |
|
898 | 897 | ? $valid_data['primary_attendee'] |
899 | 898 | : false; |
900 | - unset( $valid_data['primary_attendee'] ); |
|
899 | + unset($valid_data['primary_attendee']); |
|
901 | 900 | } |
902 | 901 | // now loop through our array of valid post data && process attendee reg forms |
903 | - foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs ) { |
|
904 | - if ( ! in_array( $form_section, $non_input_form_sections )) { |
|
905 | - foreach ( $form_inputs as $form_input => $input_value ) { |
|
902 | + foreach ($valid_data[$reg_url_link] as $form_section => $form_inputs) { |
|
903 | + if ( ! in_array($form_section, $non_input_form_sections)) { |
|
904 | + foreach ($form_inputs as $form_input => $input_value) { |
|
906 | 905 | // \EEH_Debug_Tools::printr( $input_value, $form_input, __FILE__, __LINE__ ); |
907 | 906 | // check for critical inputs |
908 | 907 | if ( |
@@ -916,16 +915,16 @@ discard block |
||
916 | 915 | // store a bit of data about the primary attendee |
917 | 916 | if ( |
918 | 917 | $att_nmbr === 1 |
919 | - && ! empty( $input_value ) |
|
918 | + && ! empty($input_value) |
|
920 | 919 | && $reg_url_link === $primary_registrant['line_item_id'] |
921 | 920 | ) { |
922 | - $primary_registrant[ $form_input ] = $input_value; |
|
921 | + $primary_registrant[$form_input] = $input_value; |
|
923 | 922 | } else if ( |
924 | 923 | $copy_primary |
925 | 924 | && $input_value === null |
926 | - && isset( $primary_registrant[ $form_input ] ) |
|
925 | + && isset($primary_registrant[$form_input]) |
|
927 | 926 | ) { |
928 | - $input_value = $primary_registrant[ $form_input ]; |
|
927 | + $input_value = $primary_registrant[$form_input]; |
|
929 | 928 | } |
930 | 929 | // now attempt to save the input data |
931 | 930 | if ( |
@@ -967,55 +966,55 @@ discard block |
||
967 | 966 | // have we met before? |
968 | 967 | $attendee = $this->_find_existing_attendee( |
969 | 968 | $registration, |
970 | - $this->_attendee_data[ $reg_url_link ] |
|
969 | + $this->_attendee_data[$reg_url_link] |
|
971 | 970 | ); |
972 | 971 | // did we find an already existing record for this attendee ? |
973 | - if ( $attendee instanceof EE_Attendee ) { |
|
972 | + if ($attendee instanceof EE_Attendee) { |
|
974 | 973 | $attendee = $this->_update_existing_attendee_data( |
975 | 974 | $attendee, |
976 | - $this->_attendee_data[ $reg_url_link ] |
|
975 | + $this->_attendee_data[$reg_url_link] |
|
977 | 976 | ); |
978 | 977 | } else { |
979 | 978 | // ensure critical details are set for additional attendees |
980 | - $this->_attendee_data[ $reg_url_link ] = $att_nmbr > 1 |
|
979 | + $this->_attendee_data[$reg_url_link] = $att_nmbr > 1 |
|
981 | 980 | ? $this->_copy_critical_attendee_details_from_primary_registrant( |
982 | - $this->_attendee_data[ $reg_url_link ] |
|
981 | + $this->_attendee_data[$reg_url_link] |
|
983 | 982 | ) |
984 | - : $this->_attendee_data[ $reg_url_link ]; |
|
983 | + : $this->_attendee_data[$reg_url_link]; |
|
985 | 984 | $attendee = $this->_create_new_attendee( |
986 | 985 | $registration, |
987 | - $this->_attendee_data[ $reg_url_link ] |
|
986 | + $this->_attendee_data[$reg_url_link] |
|
988 | 987 | ); |
989 | 988 | } |
990 | 989 | // who's #1 ? |
991 | - if ( $att_nmbr === 1 ) { |
|
990 | + if ($att_nmbr === 1) { |
|
992 | 991 | $this->checkout->primary_attendee_obj = $attendee; |
993 | 992 | } |
994 | 993 | } |
995 | 994 | // EEH_Debug_Tools::printr( $attendee, '$attendee', __FILE__, __LINE__ ); |
996 | 995 | // add relation to registration, set attendee ID, and cache attendee |
997 | - $this->_associate_attendee_with_registration( $registration, $attendee ); |
|
996 | + $this->_associate_attendee_with_registration($registration, $attendee); |
|
998 | 997 | // \EEH_Debug_Tools::printr( $registration, '$registration', __FILE__, __LINE__ ); |
999 | - if ( ! $registration->attendee() instanceof EE_Attendee ) { |
|
1000 | - EE_Error::add_error( sprintf( __( 'Registration %s has an invalid or missing Attendee object.', 'event_espresso' ), $reg_url_link ), __FILE__, __FUNCTION__, __LINE__ ); |
|
998 | + if ( ! $registration->attendee() instanceof EE_Attendee) { |
|
999 | + EE_Error::add_error(sprintf(__('Registration %s has an invalid or missing Attendee object.', 'event_espresso'), $reg_url_link), __FILE__, __FUNCTION__, __LINE__); |
|
1001 | 1000 | return false; |
1002 | 1001 | } |
1003 | 1002 | /** @type EE_Registration_Processor $registration_processor */ |
1004 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
1003 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
1005 | 1004 | // at this point, we should have enough details about the registrant to consider the registration NOT incomplete |
1006 | - $registration_processor->toggle_incomplete_registration_status_to_default( $registration, false ); |
|
1005 | + $registration_processor->toggle_incomplete_registration_status_to_default($registration, false); |
|
1007 | 1006 | // we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned |
1008 | 1007 | $this->checkout->transaction->toggle_failed_transaction_status(); |
1009 | 1008 | // if we've gotten this far, then let's save what we have |
1010 | 1009 | $registration->save(); |
1011 | 1010 | // add relation between TXN and registration |
1012 | - $this->_associate_registration_with_transaction( $registration ); |
|
1011 | + $this->_associate_registration_with_transaction($registration); |
|
1013 | 1012 | } // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) { |
1014 | 1013 | |
1015 | - } else { |
|
1016 | - EE_Error::add_error( __( 'An invalid or missing line item ID was encountered while attempting to process the registration form.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1014 | + } else { |
|
1015 | + EE_Error::add_error(__('An invalid or missing line item ID was encountered while attempting to process the registration form.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1017 | 1016 | // remove malformed data |
1018 | - unset( $valid_data[ $reg_url_link ] ); |
|
1017 | + unset($valid_data[$reg_url_link]); |
|
1019 | 1018 | return false; |
1020 | 1019 | } |
1021 | 1020 | |
@@ -1044,26 +1043,26 @@ discard block |
||
1044 | 1043 | // \EEH_Debug_Tools::printr( $input_value, '$input_value', __FILE__, __LINE__ ); |
1045 | 1044 | // allow for plugins to hook in and do their own processing of the form input. |
1046 | 1045 | // For plugins to bypass normal processing here, they just need to return a boolean value. |
1047 | - if ( apply_filters( |
|
1046 | + if (apply_filters( |
|
1048 | 1047 | 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___save_registration_form_input', |
1049 | 1048 | false, |
1050 | 1049 | $registration, |
1051 | 1050 | $form_input, |
1052 | 1051 | $input_value, |
1053 | 1052 | $this |
1054 | - ) ) { |
|
1053 | + )) { |
|
1055 | 1054 | return true; |
1056 | 1055 | } |
1057 | 1056 | // $answer_cache_id is the key used to find the EE_Answer we want |
1058 | 1057 | $answer_cache_id = $this->checkout->reg_url_link |
1059 | 1058 | ? $form_input |
1060 | - : $form_input . '-' . $registration->reg_url_link(); |
|
1061 | - $answer_is_obj = isset( $this->_registration_answers[ $answer_cache_id ] ) |
|
1062 | - && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer |
|
1059 | + : $form_input.'-'.$registration->reg_url_link(); |
|
1060 | + $answer_is_obj = isset($this->_registration_answers[$answer_cache_id]) |
|
1061 | + && $this->_registration_answers[$answer_cache_id] instanceof EE_Answer |
|
1063 | 1062 | ? true |
1064 | 1063 | : false; |
1065 | 1064 | //rename form_inputs if they are EE_Attendee properties |
1066 | - switch( (string)$form_input ) { |
|
1065 | + switch ((string) $form_input) { |
|
1067 | 1066 | |
1068 | 1067 | case 'state' : |
1069 | 1068 | case 'STA_ID' : |
@@ -1078,32 +1077,32 @@ discard block |
||
1078 | 1077 | break; |
1079 | 1078 | |
1080 | 1079 | default : |
1081 | - $ATT_input = 'ATT_' . $form_input; |
|
1080 | + $ATT_input = 'ATT_'.$form_input; |
|
1082 | 1081 | //EEH_Debug_Tools::printr( $ATT_input, '$ATT_input', __FILE__, __LINE__ ); |
1083 | - $attendee_property = EEM_Attendee::instance()->has_field( $ATT_input ) ? true : false; |
|
1084 | - $form_input = $attendee_property ? 'ATT_' . $form_input : $form_input; |
|
1082 | + $attendee_property = EEM_Attendee::instance()->has_field($ATT_input) ? true : false; |
|
1083 | + $form_input = $attendee_property ? 'ATT_'.$form_input : $form_input; |
|
1085 | 1084 | } |
1086 | 1085 | // EEH_Debug_Tools::printr( $answer_cache_id, '$answer_cache_id', __FILE__, __LINE__ ); |
1087 | 1086 | // EEH_Debug_Tools::printr( $attendee_property, '$attendee_property', __FILE__, __LINE__ ); |
1088 | 1087 | // EEH_Debug_Tools::printr( $answer_is_obj, '$answer_is_obj', __FILE__, __LINE__ ); |
1089 | 1088 | // if this form input has a corresponding attendee property |
1090 | - if ( $attendee_property ) { |
|
1091 | - $this->_attendee_data[ $registration->reg_url_link() ][ $form_input ] = $input_value; |
|
1092 | - if ( $answer_is_obj ) { |
|
1089 | + if ($attendee_property) { |
|
1090 | + $this->_attendee_data[$registration->reg_url_link()][$form_input] = $input_value; |
|
1091 | + if ($answer_is_obj) { |
|
1093 | 1092 | // and delete the corresponding answer since we won't be storing this data in that object |
1094 | - $registration->_remove_relation_to( $this->_registration_answers[ $answer_cache_id ], 'Answer' ); |
|
1095 | - $this->_registration_answers[ $answer_cache_id ]->delete_permanently(); |
|
1093 | + $registration->_remove_relation_to($this->_registration_answers[$answer_cache_id], 'Answer'); |
|
1094 | + $this->_registration_answers[$answer_cache_id]->delete_permanently(); |
|
1096 | 1095 | } |
1097 | 1096 | return true; |
1098 | - } elseif ( $answer_is_obj ) { |
|
1097 | + } elseif ($answer_is_obj) { |
|
1099 | 1098 | // save this data to the answer object |
1100 | - $this->_registration_answers[ $answer_cache_id ]->set_value( $input_value ); |
|
1101 | - $result = $this->_registration_answers[ $answer_cache_id ]->save(); |
|
1099 | + $this->_registration_answers[$answer_cache_id]->set_value($input_value); |
|
1100 | + $result = $this->_registration_answers[$answer_cache_id]->save(); |
|
1102 | 1101 | return $result !== false ? true : false; |
1103 | 1102 | } else { |
1104 | - foreach ( $this->_registration_answers as $answer ) { |
|
1105 | - if ( $answer instanceof EE_Answer && $answer->question_ID() === $answer_cache_id ) { |
|
1106 | - $answer->set_value( $input_value ); |
|
1103 | + foreach ($this->_registration_answers as $answer) { |
|
1104 | + if ($answer instanceof EE_Answer && $answer->question_ID() === $answer_cache_id) { |
|
1105 | + $answer->set_value($input_value); |
|
1107 | 1106 | $result = $answer->save(); |
1108 | 1107 | return $result !== false ? true : false; |
1109 | 1108 | } |
@@ -1125,15 +1124,15 @@ discard block |
||
1125 | 1124 | $form_input = '', |
1126 | 1125 | $input_value = '' |
1127 | 1126 | ) { |
1128 | - if ( empty( $input_value ) ) { |
|
1127 | + if (empty($input_value)) { |
|
1129 | 1128 | // if the form input isn't marked as being required, then just return |
1130 | - if ( ! isset( $this->_required_questions[ $form_input ] ) || ! $this->_required_questions[ $form_input ] ) { |
|
1129 | + if ( ! isset($this->_required_questions[$form_input]) || ! $this->_required_questions[$form_input]) { |
|
1131 | 1130 | return true; |
1132 | 1131 | } |
1133 | - switch ( $form_input ) { |
|
1132 | + switch ($form_input) { |
|
1134 | 1133 | case 'fname' : |
1135 | 1134 | EE_Error::add_error( |
1136 | - __( 'First Name is a required value.', 'event_espresso' ), |
|
1135 | + __('First Name is a required value.', 'event_espresso'), |
|
1137 | 1136 | __FILE__, |
1138 | 1137 | __FUNCTION__, |
1139 | 1138 | __LINE__ |
@@ -1142,7 +1141,7 @@ discard block |
||
1142 | 1141 | break; |
1143 | 1142 | case 'lname' : |
1144 | 1143 | EE_Error::add_error( |
1145 | - __( 'Last Name is a required value.', 'event_espresso' ), |
|
1144 | + __('Last Name is a required value.', 'event_espresso'), |
|
1146 | 1145 | __FILE__, |
1147 | 1146 | __FUNCTION__, |
1148 | 1147 | __LINE__ |
@@ -1151,7 +1150,7 @@ discard block |
||
1151 | 1150 | break; |
1152 | 1151 | case 'email' : |
1153 | 1152 | EE_Error::add_error( |
1154 | - __( 'Please enter a valid email address.', 'event_espresso' ), |
|
1153 | + __('Please enter a valid email address.', 'event_espresso'), |
|
1155 | 1154 | __FILE__, |
1156 | 1155 | __FUNCTION__, |
1157 | 1156 | __LINE__ |
@@ -1173,30 +1172,30 @@ discard block |
||
1173 | 1172 | * @return boolean|EE_Attendee |
1174 | 1173 | * @throws \EE_Error |
1175 | 1174 | */ |
1176 | - private function _find_existing_attendee( EE_Registration $registration, $attendee_data = array() ) { |
|
1175 | + private function _find_existing_attendee(EE_Registration $registration, $attendee_data = array()) { |
|
1177 | 1176 | $existing_attendee = null; |
1178 | 1177 | // if none of the critical properties are set in the incoming attendee data... |
1179 | 1178 | // then attempt to copy them from the primary attendee |
1180 | 1179 | if ( |
1181 | 1180 | $this->checkout->primary_attendee_obj instanceof EE_Attendee |
1182 | - && ! isset( $attendee_data['ATT_fname'], $attendee_data['ATT_email'] ) |
|
1181 | + && ! isset($attendee_data['ATT_fname'], $attendee_data['ATT_email']) |
|
1183 | 1182 | ) { |
1184 | 1183 | return $this->checkout->primary_attendee_obj; |
1185 | 1184 | } |
1186 | 1185 | // does this attendee already exist in the db ? |
1187 | 1186 | // we're searching using a combination of first name, last name, AND email address |
1188 | - $ATT_fname = isset( $attendee_data['ATT_fname'] ) && ! empty( $attendee_data['ATT_fname'] ) |
|
1187 | + $ATT_fname = isset($attendee_data['ATT_fname']) && ! empty($attendee_data['ATT_fname']) |
|
1189 | 1188 | ? $attendee_data['ATT_fname'] |
1190 | 1189 | : ''; |
1191 | - $ATT_lname = isset( $attendee_data['ATT_lname'] ) && ! empty( $attendee_data['ATT_lname'] ) |
|
1190 | + $ATT_lname = isset($attendee_data['ATT_lname']) && ! empty($attendee_data['ATT_lname']) |
|
1192 | 1191 | ? $attendee_data['ATT_lname'] |
1193 | 1192 | : ''; |
1194 | - $ATT_email = isset( $attendee_data['ATT_email'] ) && ! empty( $attendee_data['ATT_email'] ) |
|
1193 | + $ATT_email = isset($attendee_data['ATT_email']) && ! empty($attendee_data['ATT_email']) |
|
1195 | 1194 | ? $attendee_data['ATT_email'] |
1196 | 1195 | : ''; |
1197 | 1196 | // but only if those have values |
1198 | - if ( $ATT_fname && $ATT_lname && $ATT_email ) { |
|
1199 | - $existing_attendee = EEM_Attendee::instance()->find_existing_attendee( array( |
|
1197 | + if ($ATT_fname && $ATT_lname && $ATT_email) { |
|
1198 | + $existing_attendee = EEM_Attendee::instance()->find_existing_attendee(array( |
|
1200 | 1199 | 'ATT_fname' => $ATT_fname, |
1201 | 1200 | 'ATT_lname' => $ATT_lname, |
1202 | 1201 | 'ATT_email' => $ATT_email |
@@ -1220,13 +1219,13 @@ discard block |
||
1220 | 1219 | * @return \EE_Attendee |
1221 | 1220 | * @throws \EE_Error |
1222 | 1221 | */ |
1223 | - private function _update_existing_attendee_data( EE_Attendee $existing_attendee, $attendee_data = array() ) { |
|
1222 | + private function _update_existing_attendee_data(EE_Attendee $existing_attendee, $attendee_data = array()) { |
|
1224 | 1223 | // first remove fname, lname, and email from attendee data |
1225 | - $dont_set = array( 'ATT_fname', 'ATT_lname', 'ATT_email' ); |
|
1224 | + $dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email'); |
|
1226 | 1225 | // now loop thru what's left and add to attendee CPT |
1227 | - foreach ( $attendee_data as $property_name => $property_value ) { |
|
1228 | - if ( ! in_array( $property_name, $dont_set ) && EEM_Attendee::instance()->has_field( $property_name )) { |
|
1229 | - $existing_attendee->set( $property_name, $property_value ); |
|
1226 | + foreach ($attendee_data as $property_name => $property_value) { |
|
1227 | + if ( ! in_array($property_name, $dont_set) && EEM_Attendee::instance()->has_field($property_name)) { |
|
1228 | + $existing_attendee->set($property_name, $property_value); |
|
1230 | 1229 | } |
1231 | 1230 | } |
1232 | 1231 | // better save that now |
@@ -1244,11 +1243,11 @@ discard block |
||
1244 | 1243 | * @return void |
1245 | 1244 | * @throws \EE_Error |
1246 | 1245 | */ |
1247 | - private function _associate_attendee_with_registration( EE_Registration $registration, EE_Attendee $attendee ) { |
|
1246 | + private function _associate_attendee_with_registration(EE_Registration $registration, EE_Attendee $attendee) { |
|
1248 | 1247 | // add relation to attendee |
1249 | - $registration->_add_relation_to( $attendee, 'Attendee' ); |
|
1250 | - $registration->set_attendee_id( $attendee->ID() ); |
|
1251 | - $registration->update_cache_after_object_save( 'Attendee', $attendee ); |
|
1248 | + $registration->_add_relation_to($attendee, 'Attendee'); |
|
1249 | + $registration->set_attendee_id($attendee->ID()); |
|
1250 | + $registration->update_cache_after_object_save('Attendee', $attendee); |
|
1252 | 1251 | } |
1253 | 1252 | |
1254 | 1253 | |
@@ -1260,10 +1259,10 @@ discard block |
||
1260 | 1259 | * @return void |
1261 | 1260 | * @throws \EE_Error |
1262 | 1261 | */ |
1263 | - private function _associate_registration_with_transaction( EE_Registration $registration ) { |
|
1262 | + private function _associate_registration_with_transaction(EE_Registration $registration) { |
|
1264 | 1263 | // add relation to attendee |
1265 | - $this->checkout->transaction->_add_relation_to( $registration, 'Registration' ); |
|
1266 | - $this->checkout->transaction->update_cache_after_object_save( 'Registration', $registration ); |
|
1264 | + $this->checkout->transaction->_add_relation_to($registration, 'Registration'); |
|
1265 | + $this->checkout->transaction->update_cache_after_object_save('Registration', $registration); |
|
1267 | 1266 | } |
1268 | 1267 | |
1269 | 1268 | |
@@ -1276,14 +1275,14 @@ discard block |
||
1276 | 1275 | * @return array |
1277 | 1276 | * @throws \EE_Error |
1278 | 1277 | */ |
1279 | - private function _copy_critical_attendee_details_from_primary_registrant( $attendee_data = array() ) { |
|
1278 | + private function _copy_critical_attendee_details_from_primary_registrant($attendee_data = array()) { |
|
1280 | 1279 | // bare minimum critical details include first name, last name, email address |
1281 | - $critical_attendee_details = array( 'ATT_fname', 'ATT_lname', 'ATT_email' ); |
|
1280 | + $critical_attendee_details = array('ATT_fname', 'ATT_lname', 'ATT_email'); |
|
1282 | 1281 | // add address info to critical details? |
1283 | - if ( apply_filters( |
|
1282 | + if (apply_filters( |
|
1284 | 1283 | 'FHEE__EE_SPCO_Reg_Step_Attendee_Information__merge_address_details_with_critical_attendee_details', |
1285 | 1284 | false |
1286 | - ) ) { |
|
1285 | + )) { |
|
1287 | 1286 | $address_details = array( |
1288 | 1287 | 'ATT_address', |
1289 | 1288 | 'ATT_address2', |
@@ -1293,13 +1292,13 @@ discard block |
||
1293 | 1292 | 'ATT_zip', |
1294 | 1293 | 'ATT_phone' |
1295 | 1294 | ); |
1296 | - $critical_attendee_details = array_merge( $critical_attendee_details, $address_details ); |
|
1295 | + $critical_attendee_details = array_merge($critical_attendee_details, $address_details); |
|
1297 | 1296 | } |
1298 | - foreach ( $critical_attendee_details as $critical_attendee_detail ) { |
|
1299 | - if ( ! isset( $attendee_data[ $critical_attendee_detail ] ) |
|
1300 | - || empty( $attendee_data[ $critical_attendee_detail ] ) |
|
1297 | + foreach ($critical_attendee_details as $critical_attendee_detail) { |
|
1298 | + if ( ! isset($attendee_data[$critical_attendee_detail]) |
|
1299 | + || empty($attendee_data[$critical_attendee_detail]) |
|
1301 | 1300 | ) { |
1302 | - $attendee_data[ $critical_attendee_detail ] = $this->checkout->primary_attendee_obj->get( |
|
1301 | + $attendee_data[$critical_attendee_detail] = $this->checkout->primary_attendee_obj->get( |
|
1303 | 1302 | $critical_attendee_detail |
1304 | 1303 | ); |
1305 | 1304 | } |
@@ -1317,11 +1316,11 @@ discard block |
||
1317 | 1316 | * @return \EE_Attendee |
1318 | 1317 | * @throws \EE_Error |
1319 | 1318 | */ |
1320 | - private function _create_new_attendee( EE_Registration $registration, $attendee_data = array() ) { |
|
1319 | + private function _create_new_attendee(EE_Registration $registration, $attendee_data = array()) { |
|
1321 | 1320 | // create new attendee object |
1322 | - $new_attendee = EE_Attendee::new_instance( $attendee_data ); |
|
1321 | + $new_attendee = EE_Attendee::new_instance($attendee_data); |
|
1323 | 1322 | // set author to event creator |
1324 | - $new_attendee->set( 'ATT_author', $registration->event()->wp_user() ); |
|
1323 | + $new_attendee->set('ATT_author', $registration->event()->wp_user()); |
|
1325 | 1324 | $new_attendee->save(); |
1326 | 1325 | return $new_attendee; |
1327 | 1326 | } |
@@ -1338,7 +1337,7 @@ discard block |
||
1338 | 1337 | */ |
1339 | 1338 | public function update_reg_step() { |
1340 | 1339 | // save everything |
1341 | - if ( $this->process_reg_step() ) { |
|
1340 | + if ($this->process_reg_step()) { |
|
1342 | 1341 | $this->checkout->redirect = true; |
1343 | 1342 | $this->checkout->redirect_url = add_query_arg( |
1344 | 1343 | array( |
@@ -1347,7 +1346,7 @@ discard block |
||
1347 | 1346 | ), |
1348 | 1347 | $this->checkout->thank_you_page_url |
1349 | 1348 | ); |
1350 | - $this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url ); |
|
1349 | + $this->checkout->json_response->set_redirect_url($this->checkout->redirect_url); |
|
1351 | 1350 | return true; |
1352 | 1351 | } |
1353 | 1352 | return false; |
@@ -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 | * |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @return EED_Venue_Single |
28 | 28 | */ |
29 | 29 | public static function instance() { |
30 | - return parent::get_instance( __CLASS__ ); |
|
30 | + return parent::get_instance(__CLASS__); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @return void |
38 | 38 | */ |
39 | 39 | public static function set_hooks() { |
40 | - EE_Config::register_route( 'venue', 'Venue_Single', 'run' ); |
|
40 | + EE_Config::register_route('venue', 'Venue_Single', 'run'); |
|
41 | 41 | // EE_Config::register_view( 'venue', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'single-espresso_venues.php' ); |
42 | 42 | } |
43 | 43 | |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | * @access public |
59 | 59 | * @param \WP $WP |
60 | 60 | */ |
61 | - public function run( $WP ) { |
|
61 | + public function run($WP) { |
|
62 | 62 | // check what template is loaded |
63 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
64 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
63 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
64 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | * @param string $template |
74 | 74 | * @return string |
75 | 75 | */ |
76 | - public function template_include( $template ) { |
|
76 | + public function template_include($template) { |
|
77 | 77 | // not a custom template? |
78 | - if ( EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'single-espresso_venues.php' ) { |
|
78 | + if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'single-espresso_venues.php') { |
|
79 | 79 | EEH_Template::load_espresso_theme_functions(); |
80 | 80 | // then add extra event data via hooks |
81 | - add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 ); |
|
82 | - add_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
81 | + add_filter('the_title', array($this, 'the_title'), 100, 1); |
|
82 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
83 | 83 | // don't display entry meta because the existing theme will take car of that |
84 | - add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' ); |
|
84 | + add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
85 | 85 | } |
86 | 86 | return $template; |
87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param string $title |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - public function the_title( $title = '' ) { |
|
98 | + public function the_title($title = '') { |
|
99 | 99 | return $title; |
100 | 100 | } |
101 | 101 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param string $content |
108 | 108 | * @return string |
109 | 109 | */ |
110 | - public function venue_details( $content ) { |
|
110 | + public function venue_details($content) { |
|
111 | 111 | global $post; |
112 | 112 | if ( |
113 | 113 | $post->post_type == 'espresso_venues' |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | // it uses the_content() for displaying the $post->post_content |
118 | 118 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
119 | 119 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
120 | - remove_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
120 | + remove_filter('the_content', array($this, 'venue_details'), 100); |
|
121 | 121 | // add filters we want |
122 | - add_filter( 'the_content', array( $this, 'venue_location' ), 110 ); |
|
122 | + add_filter('the_content', array($this, 'venue_location'), 110); |
|
123 | 123 | // now load our template |
124 | - $template = EEH_Template::locate_template( 'content-espresso_venues-details.php' ); |
|
124 | + $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
125 | 125 | // remove other filters we added so they won't get applied to the next post |
126 | - remove_filter( 'the_content', array( $this, 'venue_location' ), 110 ); |
|
126 | + remove_filter('the_content', array($this, 'venue_location'), 110); |
|
127 | 127 | } |
128 | 128 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
129 | - return ! empty( $template ) ? $template : $content; |
|
129 | + return ! empty($template) ? $template : $content; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | * @param string $content |
139 | 139 | * @return string |
140 | 140 | */ |
141 | - public function venue_location( $content ) { |
|
142 | - return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' ); |
|
141 | + public function venue_location($content) { |
|
142 | + return $content.EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | |
@@ -152,16 +152,16 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function wp_enqueue_scripts() { |
154 | 154 | // get some style |
155 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_single() ) { |
|
155 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_single()) { |
|
156 | 156 | // first check theme folder |
157 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
158 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
159 | - } else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) { |
|
160 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
157 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
158 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
159 | + } else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) { |
|
160 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
161 | 161 | } |
162 | - wp_enqueue_style( $this->theme ); |
|
163 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
164 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
162 | + wp_enqueue_style($this->theme); |
|
163 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
164 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | } |
@@ -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 | * |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @return EED_Venues_Archive |
28 | 28 | */ |
29 | 29 | public static function instance() { |
30 | - return parent::get_instance( __CLASS__ ); |
|
30 | + return parent::get_instance(__CLASS__); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @return void |
38 | 38 | */ |
39 | 39 | public static function set_hooks() { |
40 | - EE_Config::register_route( 'venues', 'Venues_Archive', 'run' ); |
|
40 | + EE_Config::register_route('venues', 'Venues_Archive', 'run'); |
|
41 | 41 | // EE_Config::register_view( 'venues', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.php' ); |
42 | 42 | } |
43 | 43 | |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | * @access public |
59 | 59 | * @param \WP $WP |
60 | 60 | */ |
61 | - public function run( $WP ) { |
|
61 | + public function run($WP) { |
|
62 | 62 | // check what template is loaded |
63 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
64 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
63 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
64 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -73,18 +73,18 @@ discard block |
||
73 | 73 | * @param string $template |
74 | 74 | * @return string |
75 | 75 | */ |
76 | - public function template_include( $template ) { |
|
76 | + public function template_include($template) { |
|
77 | 77 | // not a custom template? |
78 | - if ( EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'archive-espresso_venues.php' ) { |
|
78 | + if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'archive-espresso_venues.php') { |
|
79 | 79 | EEH_Template::load_espresso_theme_functions(); |
80 | 80 | // then add extra event data via hooks |
81 | - add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 ); |
|
81 | + add_filter('the_title', array($this, 'the_title'), 100, 1); |
|
82 | 82 | // don't know if theme uses the_excerpt |
83 | - add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 ); |
|
83 | + add_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
84 | 84 | // or the_content |
85 | - add_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
85 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
86 | 86 | // don't display entry meta because the existing theme will take care of that |
87 | - add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' ); |
|
87 | + add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
88 | 88 | } |
89 | 89 | return $template; |
90 | 90 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param string $title |
99 | 99 | * @return string |
100 | 100 | */ |
101 | - public function the_title( $title = '' ) { |
|
101 | + public function the_title($title = '') { |
|
102 | 102 | return $title; |
103 | 103 | } |
104 | 104 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param string $content |
111 | 111 | * @return string |
112 | 112 | */ |
113 | - public function venue_details( $content ) { |
|
113 | + public function venue_details($content) { |
|
114 | 114 | global $post; |
115 | 115 | if ( |
116 | 116 | $post->post_type == 'espresso_venues' |
@@ -120,22 +120,22 @@ discard block |
||
120 | 120 | // it uses the_content() for displaying the $post->post_content |
121 | 121 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
122 | 122 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
123 | - remove_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 ); |
|
124 | - remove_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
123 | + remove_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
124 | + remove_filter('the_content', array($this, 'venue_details'), 100); |
|
125 | 125 | // add filters we want |
126 | - add_filter( 'the_content', array( $this, 'venue_location' ), 110 ); |
|
127 | - add_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 ); |
|
126 | + add_filter('the_content', array($this, 'venue_location'), 110); |
|
127 | + add_filter('the_excerpt', array($this, 'venue_location'), 110); |
|
128 | 128 | // now load our template |
129 | - $template = EEH_Template::locate_template( 'content-espresso_venues-details.php' ); |
|
129 | + $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
130 | 130 | //now add our filter back in, plus some others |
131 | - add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 ); |
|
132 | - add_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
131 | + add_filter('the_excerpt', array($this, 'venue_details'), 100); |
|
132 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
133 | 133 | // remove other filters we added so they won't get applied to the next post |
134 | - remove_filter( 'the_content', array( $this, 'venue_location' ), 110 ); |
|
135 | - remove_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 ); |
|
134 | + remove_filter('the_content', array($this, 'venue_location'), 110); |
|
135 | + remove_filter('the_excerpt', array($this, 'venue_location'), 110); |
|
136 | 136 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
137 | 137 | } |
138 | - return ! empty( $template ) ? $template : $content; |
|
138 | + return ! empty($template) ? $template : $content; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | * @param string $content |
148 | 148 | * @return string |
149 | 149 | */ |
150 | - public function venue_location( $content ) { |
|
151 | - return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' ); |
|
150 | + public function venue_location($content) { |
|
151 | + return $content.EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function wp_enqueue_scripts() { |
164 | 164 | // get some style |
165 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_archive() ) { |
|
165 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_archive()) { |
|
166 | 166 | // first check theme folder |
167 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
168 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
169 | - } else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) { |
|
170 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
167 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
168 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
169 | + } else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) { |
|
170 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
171 | 171 | } |
172 | - wp_enqueue_style( $this->theme ); |
|
172 | + wp_enqueue_style($this->theme); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 |
@@ -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 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct($pm_instance = NULL) { |
38 | 38 | $this->_pretty_name = __("Invoice", 'event_espresso'); |
39 | 39 | $this->_default_description = sprintf( |
40 | - __( 'After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.%1$sPlease note that event spaces will not be reserved until payment is received in full, and any remaining tickets could be sold to others in the meantime.%2$s%3$s', 'event_espresso' ), |
|
40 | + __('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.%1$sPlease note that event spaces will not be reserved until payment is received in full, and any remaining tickets could be sold to others in the meantime.%2$s%3$s', 'event_espresso'), |
|
41 | 41 | '<br />', |
42 | 42 | '<span class="important-notice">', |
43 | 43 | '</span>' |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param \EE_Transaction $transaction |
54 | 54 | * @return NULL |
55 | 55 | */ |
56 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
56 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
57 | 57 | return NULL; |
58 | 58 | } |
59 | 59 | |
@@ -66,53 +66,53 @@ discard block |
||
66 | 66 | public function generate_new_settings_form() { |
67 | 67 | $pdf_payee_input_name = 'pdf_payee_name'; |
68 | 68 | $confirmation_text_input_name = 'page_confirmation_text'; |
69 | - $form = new EE_Payment_Method_Form(array( |
|
69 | + $form = new EE_Payment_Method_Form(array( |
|
70 | 70 | // 'payment_method_type' => $this, |
71 | 71 | 'extra_meta_inputs'=>array( |
72 | 72 | $pdf_payee_input_name => new EE_Text_Input(array( |
73 | - 'html_label_text' => sprintf( __( 'Payee Name %s', 'event_espresso' ), $this->get_help_tab_link()) |
|
73 | + 'html_label_text' => sprintf(__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()) |
|
74 | 74 | )), |
75 | 75 | 'pdf_payee_email' => new EE_Email_Input(array( |
76 | - 'html_label_text' => sprintf( __( 'Payee Email %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
76 | + 'html_label_text' => sprintf(__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()), |
|
77 | 77 | )), |
78 | 78 | 'pdf_payee_tax_number' => new EE_Text_Input(array( |
79 | - 'html_label_text' => sprintf( __( 'Payee Tax Number %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
79 | + 'html_label_text' => sprintf(__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()), |
|
80 | 80 | )), |
81 | - 'pdf_payee_address' => new EE_Text_Area_Input( array( |
|
82 | - 'html_label_text' => sprintf( __( 'Payee Address %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
83 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
81 | + 'pdf_payee_address' => new EE_Text_Area_Input(array( |
|
82 | + 'html_label_text' => sprintf(__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
83 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
84 | 84 | )), |
85 | 85 | 'pdf_instructions'=>new EE_Text_Area_Input(array( |
86 | - 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
86 | + 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
87 | 87 | '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'), |
88 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
88 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
89 | 89 | )), |
90 | 90 | 'pdf_logo_image'=>new EE_Admin_File_Uploader_Input(array( |
91 | - 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
91 | + 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
92 | 92 | 'default'=> EE_Config::instance()->organization->logo_url, |
93 | 93 | 'html_help_text'=> __("(Logo for the top left of the invoice)", 'event_espresso'), |
94 | 94 | )), |
95 | 95 | $confirmation_text_input_name =>new EE_Text_Area_Input(array( |
96 | - 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
96 | + 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
97 | 97 | 'default'=> __("Payment must be received within 48 hours of event date. Details about where to send payment is included on the invoice.", 'event_espresso'), |
98 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
98 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
99 | 99 | )), |
100 | 100 | 'page_extra_info'=>new EE_Text_Area_Input(array( |
101 | - 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
102 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
101 | + 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
102 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
103 | 103 | )), |
104 | 104 | ), |
105 | 105 | 'include'=>array( |
106 | - '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', |
|
107 | - $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
106 | + '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', |
|
107 | + $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image', |
|
108 | 108 | $confirmation_text_input_name, 'page_extra_info'), |
109 | 109 | )); |
110 | 110 | $form->add_subsections( |
111 | - array( 'header1' => new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_display.template.php' )), |
|
111 | + array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
112 | 112 | $pdf_payee_input_name |
113 | 113 | ); |
114 | 114 | $form->add_subsections( |
115 | - array( 'header2'=>new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php' )), |
|
115 | + array('header2'=>new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
116 | 116 | $confirmation_text_input_name |
117 | 117 | ); |
118 | 118 | return $form; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @see EE_PMT_Base::help_tabs_config() |
126 | 126 | * @return array |
127 | 127 | */ |
128 | - public function help_tabs_config(){ |
|
128 | + public function help_tabs_config() { |
|
129 | 129 | return array( |
130 | 130 | $this->get_help_tab_name() => array( |
131 | 131 | 'title' => __('Invoice Settings', 'event_espresso'), |
@@ -143,17 +143,17 @@ discard block |
||
143 | 143 | * @param \EE_Payment $payment |
144 | 144 | * @return string |
145 | 145 | */ |
146 | - public function payment_overview_content( EE_Payment $payment ){ |
|
146 | + public function payment_overview_content(EE_Payment $payment) { |
|
147 | 147 | EE_Registry::instance()->load_helper('Template'); |
148 | 148 | return EEH_Template::locate_template( |
149 | - 'payment_methods' . DS . 'Invoice'. DS . 'templates'.DS.'invoice_payment_details_content.template.php', |
|
149 | + 'payment_methods'.DS.'Invoice'.DS.'templates'.DS.'invoice_payment_details_content.template.php', |
|
150 | 150 | array_merge( |
151 | 151 | array( |
152 | 152 | 'payment_method' => $this->_pm_instance, |
153 | 153 | 'payment' => $payment, |
154 | 154 | 'page_confirmation_text' => '', |
155 | 155 | 'page_extra_info' => '', |
156 | - 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url( 'html' ) |
|
156 | + 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html') |
|
157 | 157 | ), |
158 | 158 | $this->_pm_instance->all_extra_meta_array() |
159 | 159 | ) |
@@ -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 |