Completed
Branch BUG-9680-compress-dompdf-files... (43e183)
by
unknown
68:51 queued 56:46
created
modules/ticket_selector/EED_Ticket_Selector.module.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 	protected static $_event = NULL;
36 36
 
37 37
 	/**
38
-	* array of datetimes and the spaces available for them
39
-	*
40
-	* @access private
41
-	* @var array
42
-	*/
38
+	 * array of datetimes and the spaces available for them
39
+	 *
40
+	 * @access private
41
+	 * @var array
42
+	 */
43 43
 	private static $_available_spaces = array();
44 44
 
45 45
 
@@ -208,8 +208,8 @@  discard block
 block discarded – undo
208 208
 				return $permalink_string;
209 209
 			}
210 210
 			$permalink_string .= '<a id="js-ticket-selector-embed-trigger" class="button button-small" href="#"  tabindex="-1">'
211
-			                     . __( 'Embed', 'event_espresso' )
212
-			                     . '</a> ';
211
+								 . __( 'Embed', 'event_espresso' )
212
+								 . '</a> ';
213 213
 			$ticket_selector_url = add_query_arg( array( 'ticket_selector' => 'iframe', 'event' => $id ), site_url() );
214 214
 			$iframe_string = esc_html(
215 215
 				'<iframe src="' . $ticket_selector_url . '" width="100%" height="100%"></iframe>'
@@ -884,11 +884,11 @@  discard block
 block discarded – undo
884 884
 
885 885
 
886 886
 	/**
887
-	* 	load js
888
-	*
889
-	* 	@access 		public
890
-	* 	@return 		void
891
-	*/
887
+	 * 	load js
888
+	 *
889
+	 * 	@access 		public
890
+	 * 	@return 		void
891
+	 */
892 892
 	public static function load_tckt_slctr_assets() {
893 893
 		// add some style
894 894
 		if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) {
Please login to merge, or discard this patch.
Spacing   +207 added lines, -207 removed lines patch added patch discarded remove patch
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
 	 * @return EED_Ticket_Selector
58 58
 	 */
59 59
 	public static function instance() {
60
-		return parent::get_instance( __CLASS__ );
60
+		return parent::get_instance(__CLASS__);
61 61
 	}
62 62
 
63 63
 
64 64
 
65
-	protected function set_config(){
66
-		$this->set_config_section( 'template_settings' );
67
-		$this->set_config_class( 'EE_Ticket_Selector_Config' );
68
-		$this->set_config_name( 'EED_Ticket_Selector' );
65
+	protected function set_config() {
66
+		$this->set_config_section('template_settings');
67
+		$this->set_config_class('EE_Ticket_Selector_Config');
68
+		$this->set_config_name('EED_Ticket_Selector');
69 69
 	}
70 70
 
71 71
 
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public static function set_hooks() {
82 82
 		// routing
83
-		EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' );
84
-		EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' );
85
-		add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
83
+		EE_Config::register_route('iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector');
84
+		EE_Config::register_route('process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections');
85
+		add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2);
86 86
 		//add_action( 'AHEE_event_details_before_post', array( 'EED_Ticket_Selector', 'ticket_selector_form_open' ), 10, 1 );
87
-		add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 );
87
+		add_action('AHEE_event_details_header_bottom', array('EED_Ticket_Selector', 'display_ticket_selector'), 10, 1);
88 88
 		//add_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', array( 'EED_Ticket_Selector', 'display_ticket_selector_submit' ), 10, 1 );
89 89
 		//add_action( 'AHEE_event_details_after_post', array( 'EED_Ticket_Selector', 'ticket_selector_form_close' ), 10 );
90
-		add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 );
90
+		add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets'), 10);
91 91
 	}
92 92
 
93 93
 
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 *  @return 	void
100 100
 	 */
101 101
 	public static function set_hooks_admin() {
102
-		add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
102
+		add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2);
103 103
 		//add button for iframe code to event editor.
104
-		add_filter( 'get_sample_permalink_html', array( 'EED_Ticket_Selector', 'iframe_code_button' ), 10, 4 );
105
-		add_action( 'admin_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets_admin' ), 10 );
104
+		add_filter('get_sample_permalink_html', array('EED_Ticket_Selector', 'iframe_code_button'), 10, 4);
105
+		add_action('admin_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets_admin'), 10);
106 106
 	}
107 107
 
108 108
 
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 	 *  @return 	void
115 115
 	 */
116 116
 	public static function set_definitions() {
117
-		define( 'TICKET_SELECTOR_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
118
-		define( 'TICKET_SELECTOR_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
117
+		define('TICKET_SELECTOR_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
118
+		define('TICKET_SELECTOR_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
119 119
 
120 120
 		//if config is not set, initialize
121 121
 		//If config is not set, set it.
122
-		if ( ! isset( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) ) {
122
+		if ( ! isset(EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector)) {
123 123
 			EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = new EE_Ticket_Selector_Config();
124 124
 		}
125
-		EE_Registry::$i18n_js_strings[ 'ts_embed_iframe_title' ] = __( 'Copy and Paste the following:', 'event_espresso' );
125
+		EE_Registry::$i18n_js_strings['ts_embed_iframe_title'] = __('Copy and Paste the following:', 'event_espresso');
126 126
 	}
127 127
 
128 128
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * 	@param	object 			$WP
134 134
 	 * 	@return 	void
135 135
 	 */
136
-	public function run( $WP ) {}
136
+	public function run($WP) {}
137 137
 
138 138
 
139 139
 	/**
@@ -145,23 +145,23 @@  discard block
 block discarded – undo
145 145
 	public function ticket_selector_iframe() {
146 146
 		self::$_in_iframe = true;
147 147
 		/** @type EEM_Event $EEM_Event */
148
-		$EEM_Event = EE_Registry::instance()->load_model( 'Event' );
148
+		$EEM_Event = EE_Registry::instance()->load_model('Event');
149 149
 		$event = $EEM_Event->get_one_by_ID(
150
-			EE_Registry::instance()->REQ->get( 'event', 0 )
150
+			EE_Registry::instance()->REQ->get('event', 0)
151 151
 		);
152
-		EE_Registry::instance()->REQ->set_espresso_page( true );
153
-		$template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector( $event );
152
+		EE_Registry::instance()->REQ->set_espresso_page(true);
153
+		$template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector($event);
154 154
 		$template_args['css'] = apply_filters(
155 155
 			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
156 156
 			array(
157
-				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_embed.css?ver=' . EVENT_ESPRESSO_VERSION,
158
-				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css?ver=' . EVENT_ESPRESSO_VERSION,
159
-				includes_url( 'css/dashicons.min.css?ver=' . $GLOBALS['wp_version'] ),
160
-				EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION
157
+				TICKET_SELECTOR_ASSETS_URL.'ticket_selector_embed.css?ver='.EVENT_ESPRESSO_VERSION,
158
+				TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css?ver='.EVENT_ESPRESSO_VERSION,
159
+				includes_url('css/dashicons.min.css?ver='.$GLOBALS['wp_version']),
160
+				EE_GLOBAL_ASSETS_URL.'css/espresso_default.css?ver='.EVENT_ESPRESSO_VERSION
161 161
 			)
162 162
 		);
163
-		EE_Registry::$i18n_js_strings[ 'ticket_selector_iframe' ] = true;
164
-		EE_Registry::$i18n_js_strings[ 'EEDTicketSelectorMsg' ] = __( 'Please choose at least one ticket before continuing.', 'event_espresso' );
163
+		EE_Registry::$i18n_js_strings['ticket_selector_iframe'] = true;
164
+		EE_Registry::$i18n_js_strings['EEDTicketSelectorMsg'] = __('Please choose at least one ticket before continuing.', 'event_espresso');
165 165
 		$template_args['eei18n'] = apply_filters(
166 166
 			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__eei18n_js_strings',
167 167
 			EE_Registry::localize_i18n_js_strings()
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
 		$template_args['js'] = apply_filters(
170 170
 			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
171 171
 			array(
172
-				includes_url( 'js/jquery/jquery.js?ver=' . $GLOBALS['wp_version'] ),
173
-				EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION,
174
-				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_iframe_embed.js?ver=' . EVENT_ESPRESSO_VERSION
172
+				includes_url('js/jquery/jquery.js?ver='.$GLOBALS['wp_version']),
173
+				EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js?ver='.EVENT_ESPRESSO_VERSION,
174
+				TICKET_SELECTOR_ASSETS_URL.'ticket_selector_iframe_embed.js?ver='.EVENT_ESPRESSO_VERSION
175 175
 			)
176 176
 		);
177
-		$template_args[ 'notices' ] = EEH_Template::display_template(
178
-			EE_TEMPLATES . 'espresso-ajax-notices.template.php',
177
+		$template_args['notices'] = EEH_Template::display_template(
178
+			EE_TEMPLATES.'espresso-ajax-notices.template.php',
179 179
 			array(),
180 180
 			true
181 181
 		);
182 182
 		EEH_Template::display_template(
183
-			TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart_iframe.template.php',
183
+			TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart_iframe.template.php',
184 184
 			$template_args
185 185
 		);
186 186
 		exit;
@@ -199,25 +199,25 @@  discard block
 block discarded – undo
199 199
 	 *
200 200
 	 * @return string The new html string for the permalink area.
201 201
 	 */
202
-	public static function iframe_code_button( $permalink_string, $id, $new_title, $new_slug ) {
202
+	public static function iframe_code_button($permalink_string, $id, $new_title, $new_slug) {
203 203
 		//make sure this is ONLY when editing and the event id has been set.
204
-		if ( ! empty( $id ) ) {
205
-			$post = get_post( $id );
204
+		if ( ! empty($id)) {
205
+			$post = get_post($id);
206 206
 			//if NOT event then let's get out.
207
-			if ( $post->post_type !== 'espresso_events' ) {
207
+			if ($post->post_type !== 'espresso_events') {
208 208
 				return $permalink_string;
209 209
 			}
210 210
 			$permalink_string .= '<a id="js-ticket-selector-embed-trigger" class="button button-small" href="#"  tabindex="-1">'
211
-			                     . __( 'Embed', 'event_espresso' )
211
+			                     . __('Embed', 'event_espresso')
212 212
 			                     . '</a> ';
213
-			$ticket_selector_url = add_query_arg( array( 'ticket_selector' => 'iframe', 'event' => $id ), site_url() );
213
+			$ticket_selector_url = add_query_arg(array('ticket_selector' => 'iframe', 'event' => $id), site_url());
214 214
 			$iframe_string = esc_html(
215
-				'<iframe src="' . $ticket_selector_url . '" width="100%" height="100%"></iframe>'
215
+				'<iframe src="'.$ticket_selector_url.'" width="100%" height="100%"></iframe>'
216 216
 			);
217 217
 			$permalink_string .= '
218 218
 <div id="js-ts-iframe" style="display:none">
219 219
 	<div style="width:100%; height: 500px;">
220
-		' . $iframe_string . '
220
+		' . $iframe_string.'
221 221
 	</div>
222 222
 </div>';
223 223
 		}
@@ -236,22 +236,22 @@  discard block
 block discarded – undo
236 236
 	 * @param 	mixed $event
237 237
 	 * @return 	bool
238 238
 	 */
239
-	protected static function set_event( $event = null ) {
240
-		if( $event === null ) {
239
+	protected static function set_event($event = null) {
240
+		if ($event === null) {
241 241
 			global $post;
242 242
 			$event = $post;
243 243
 		}
244
-		if ( $event instanceof EE_Event ) {
244
+		if ($event instanceof EE_Event) {
245 245
 			self::$_event = $event;
246
-		} else if ( $event instanceof WP_Post && isset( $event->EE_Event ) && $event->EE_Event instanceof EE_Event ) {
246
+		} else if ($event instanceof WP_Post && isset($event->EE_Event) && $event->EE_Event instanceof EE_Event) {
247 247
 			self::$_event = $event->EE_Event;
248
-		} else if ( $event instanceof WP_Post && $event->post_type == 'espresso_events' ) {
249
-			$event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event );
248
+		} else if ($event instanceof WP_Post && $event->post_type == 'espresso_events') {
249
+			$event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object($event);
250 250
 			self::$_event = $event->EE_Event;
251 251
 		} else {
252
-			$user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
253
-			$dev_msg = $user_msg . __( 'In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso' );
254
-			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
252
+			$user_msg = __('No Event object or an invalid Event object was supplied.', 'event_espresso');
253
+			$dev_msg = $user_msg.__('In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso');
254
+			EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__);
255 255
 			return false;
256 256
 		}
257 257
 		return true;
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 	 * @param 	bool 	$view_details
271 271
 	 * @return 	string
272 272
 	 */
273
-	public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) {
273
+	public static function display_ticket_selector($event = NULL, $view_details = FALSE) {
274 274
 		// reset filter for displaying submit button
275
-		remove_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' );
275
+		remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
276 276
 		// poke and prod incoming event till it tells us what it is
277
-		if ( ! EED_Ticket_Selector::set_event( $event )) {
277
+		if ( ! EED_Ticket_Selector::set_event($event)) {
278 278
 			return false;
279 279
 		}
280 280
 		$event_post = self::$_event instanceof EE_Event ? self::$_event->ID() : $event;
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			&& (
286 286
 				! self::$_event->display_ticket_selector()
287 287
 				|| $view_details
288
-				|| post_password_required( $event_post )
288
+				|| post_password_required($event_post)
289 289
 				|| (
290 290
 					$_event_active_status != EE_Datetime::active
291 291
 					&& $_event_active_status != EE_Datetime::upcoming
@@ -303,68 +303,68 @@  discard block
 block discarded – undo
303 303
 		$template_args = array();
304 304
 		$template_args['event_status'] = $_event_active_status;
305 305
 
306
-		$template_args['date_format'] = apply_filters( 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', get_option( 'date_format' ) );
307
-		$template_args['time_format'] = apply_filters( 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', get_option( 'time_format' ) );
306
+		$template_args['date_format'] = apply_filters('FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', get_option('date_format'));
307
+		$template_args['time_format'] = apply_filters('FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', get_option('time_format'));
308 308
 
309 309
 		$template_args['EVT_ID'] = self::$_event->ID();
310 310
 		$template_args['event'] = self::$_event;
311 311
 
312 312
 		// is the event expired ?
313 313
 		$template_args['event_is_expired'] = self::$_event->is_expired();
314
-		if ( $template_args['event_is_expired'] ) {
315
-			return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( 'We\'re sorry, but all tickets sales have ended because the event is expired.', 'event_espresso' ) . '</span></div>';
314
+		if ($template_args['event_is_expired']) {
315
+			return '<div class="ee-event-expired-notice"><span class="important-notice">'.__('We\'re sorry, but all tickets sales have ended because the event is expired.', 'event_espresso').'</span></div>';
316 316
 		}
317 317
 
318 318
 		$ticket_query_args = array(
319
-			array( 'Datetime.EVT_ID' => self::$_event->ID() ),
320
-			'order_by' => array( 'TKT_order' => 'ASC', 'TKT_required' => 'DESC', 'TKT_start_date' => 'ASC', 'TKT_end_date' => 'ASC' , 'Datetime.DTT_EVT_start' => 'DESC' )
319
+			array('Datetime.EVT_ID' => self::$_event->ID()),
320
+			'order_by' => array('TKT_order' => 'ASC', 'TKT_required' => 'DESC', 'TKT_start_date' => 'ASC', 'TKT_end_date' => 'ASC', 'Datetime.DTT_EVT_start' => 'DESC')
321 321
 		);
322 322
 
323
-		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets ) {
323
+		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets) {
324 324
 			//use the correct applicable time query depending on what version of core is being run.
325
-			$current_time = method_exists( 'EEM_Datetime', 'current_time_for_query' ) ? time() : current_time('timestamp');
326
-			$ticket_query_args[0]['TKT_end_date'] = array( '>', $current_time );
325
+			$current_time = method_exists('EEM_Datetime', 'current_time_for_query') ? time() : current_time('timestamp');
326
+			$ticket_query_args[0]['TKT_end_date'] = array('>', $current_time);
327 327
 		}
328 328
 
329 329
 		// get all tickets for this event ordered by the datetime
330
-		$template_args['tickets'] = EEM_Ticket::instance()->get_all( $ticket_query_args );
330
+		$template_args['tickets'] = EEM_Ticket::instance()->get_all($ticket_query_args);
331 331
 
332
-		if ( count( $template_args['tickets'] ) < 1 ) {
333
-			return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( 'We\'re sorry, but all ticket sales have ended.', 'event_espresso' ) . '</span></div>';
332
+		if (count($template_args['tickets']) < 1) {
333
+			return '<div class="ee-event-expired-notice"><span class="important-notice">'.__('We\'re sorry, but all ticket sales have ended.', 'event_espresso').'</span></div>';
334 334
 		}
335 335
 
336 336
 		// filter the maximum qty that can appear in the Ticket Selector qty dropdowns
337
-		$template_args['max_atndz'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__max_tickets', self::$_event->additional_limit() );
338
-		if ( $template_args['max_atndz'] < 1 ) {
339
-			$sales_closed_msg = __( 'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', 'event_espresso' );
340
-			if ( current_user_can( 'edit_post', self::$_event->ID() )) {
341
-				$sales_closed_msg .=  sprintf(
342
-					__( '%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s', 'event_espresso' ),
337
+		$template_args['max_atndz'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__max_tickets', self::$_event->additional_limit());
338
+		if ($template_args['max_atndz'] < 1) {
339
+			$sales_closed_msg = __('We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', 'event_espresso');
340
+			if (current_user_can('edit_post', self::$_event->ID())) {
341
+				$sales_closed_msg .= sprintf(
342
+					__('%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s', 'event_espresso'),
343 343
 					'<div class="ee-attention" style="text-align: left;"><b>',
344 344
 					'</b><br />',
345
-					$link = '<span class="edit-link"><a class="post-edit-link" href="' . get_edit_post_link( self::$_event->ID() ) . '">',
345
+					$link = '<span class="edit-link"><a class="post-edit-link" href="'.get_edit_post_link(self::$_event->ID()).'">',
346 346
 					'</a></span></div>'
347 347
 				);
348 348
 			}
349
-			return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>';
349
+			return '<p><span class="important-notice">'.$sales_closed_msg.'</span></p>';
350 350
 		}
351 351
 
352
-		$templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart.template.php';
353
-		$templates['ticket_selector'] = apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', $templates['ticket_selector'], self::$_event );
352
+		$templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart.template.php';
353
+		$templates['ticket_selector'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', $templates['ticket_selector'], self::$_event);
354 354
 
355 355
 		// redirecting to another site for registration ??
356 356
 		$external_url = self::$_event->external_url() !== NULL || self::$_event->external_url() !== '' ? self::$_event->external_url() : FALSE;
357 357
 		// set up the form (but not for the admin)
358
-		$ticket_selector = ! is_admin() ? EED_Ticket_Selector::ticket_selector_form_open( self::$_event->ID(), $external_url ) : '';
358
+		$ticket_selector = ! is_admin() ? EED_Ticket_Selector::ticket_selector_form_open(self::$_event->ID(), $external_url) : '';
359 359
 		// if not redirecting to another site for registration
360
-		if ( ! $external_url ) {
360
+		if ( ! $external_url) {
361 361
 			// then display the ticket selector
362
-			$ticket_selector .= EEH_Template::locate_template( $templates['ticket_selector'], $template_args );
362
+			$ticket_selector .= EEH_Template::locate_template($templates['ticket_selector'], $template_args);
363 363
 		} else {
364 364
 			// if not we still need to trigger the display of the submit button
365
-			add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' );
365
+			add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
366 366
 			//display notice to admin that registration is external
367
-			$ticket_selector .= ! is_admin() ? '' : __( 'Registration is at an external URL for this event.', 'event_espresso' );
367
+			$ticket_selector .= ! is_admin() ? '' : __('Registration is at an external URL for this event.', 'event_espresso');
368 368
 		}
369 369
 		// submit button and form close tag
370 370
 		$ticket_selector .= ! is_admin() ? EED_Ticket_Selector::display_ticket_selector_submit() : '';
@@ -384,25 +384,25 @@  discard block
 block discarded – undo
384 384
 	 * @param 		string $external_url
385 385
 	 * @return 		string
386 386
 	 */
387
-	public static function ticket_selector_form_open( $ID = 0, $external_url = '' ) {
387
+	public static function ticket_selector_form_open($ID = 0, $external_url = '') {
388 388
 		// if redirecting, we don't need any anything else
389
-		if ( $external_url ) {
390
-			$html = '<form method="GET" action="' . EEH_URL::refactor_url( $external_url ) . '">';
391
-			$query_args = EEH_URL::get_query_string( $external_url );
392
-			foreach ( $query_args as $query_arg => $value ) {
393
-				$html .= '<input type="hidden" name="' . $query_arg . '" value="' . $value . '">';
389
+		if ($external_url) {
390
+			$html = '<form method="GET" action="'.EEH_URL::refactor_url($external_url).'">';
391
+			$query_args = EEH_URL::get_query_string($external_url);
392
+			foreach ($query_args as $query_arg => $value) {
393
+				$html .= '<input type="hidden" name="'.$query_arg.'" value="'.$value.'">';
394 394
 			}
395 395
 			return $html;
396 396
 		}
397
-		$checkout_url = EEH_Event_View::event_link_url( $ID );
398
-		if ( ! $checkout_url ) {
399
-			EE_Error::add_error( __('The URL for the Event Details page could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
397
+		$checkout_url = EEH_Event_View::event_link_url($ID);
398
+		if ( ! $checkout_url) {
399
+			EE_Error::add_error(__('The URL for the Event Details page could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
400 400
 		}
401 401
 		$extra_params = self::$_in_iframe ? ' target="_blank"' : '';
402
-		$html = '<form method="POST" action="' . $checkout_url . '"' . $extra_params . '>';
403
-		$html .= wp_nonce_field( 	'process_ticket_selections', 'process_ticket_selections_nonce', TRUE, FALSE );
402
+		$html = '<form method="POST" action="'.$checkout_url.'"'.$extra_params.'>';
403
+		$html .= wp_nonce_field('process_ticket_selections', 'process_ticket_selections_nonce', TRUE, FALSE);
404 404
 		$html .= '<input type="hidden" name="ee" value="process_ticket_selections">';
405
-		$html = apply_filters( 'FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, self::$_event );
405
+		$html = apply_filters('FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, self::$_event);
406 406
 		return $html;
407 407
 	}
408 408
 
@@ -417,23 +417,23 @@  discard block
 block discarded – undo
417 417
 	 * 	@return		string
418 418
 	 */
419 419
 	public static function display_ticket_selector_submit() {
420
-		if ( ! is_admin() ) {
421
-			if ( apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', FALSE ) ) {
420
+		if ( ! is_admin()) {
421
+			if (apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', FALSE)) {
422 422
 				$btn_text = apply_filters(
423 423
 					'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text',
424
-					__('Register Now', 'event_espresso' ),
424
+					__('Register Now', 'event_espresso'),
425 425
 					self::$_event
426 426
 				);
427 427
 				$external_url = self::$_event->external_url();
428
-				$html = '<input id="ticket-selector-submit-'. self::$_event->ID() .'-btn"';
428
+				$html = '<input id="ticket-selector-submit-'.self::$_event->ID().'-btn"';
429 429
 				$html .= ' class="ticket-selector-submit-btn ';
430
-				$html .= empty( $external_url ) ? 'ticket-selector-submit-ajax"' : '"';
431
-				$html .= ' type="submit" value="' . $btn_text . '" />';
432
-				$html .= apply_filters( 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', '', self::$_event );
430
+				$html .= empty($external_url) ? 'ticket-selector-submit-ajax"' : '"';
431
+				$html .= ' type="submit" value="'.$btn_text.'" />';
432
+				$html .= apply_filters('FHEE__EE_Ticket_Selector__after_ticket_selector_submit', '', self::$_event);
433 433
 				$html .= '<div class="clear"><br/></div></form>';
434 434
 				return $html;
435
-			} else if ( is_archive() ) {
436
-				return EED_Ticket_Selector::ticket_selector_form_close() . EED_Ticket_Selector::display_view_details_btn();
435
+			} else if (is_archive()) {
436
+				return EED_Ticket_Selector::ticket_selector_form_close().EED_Ticket_Selector::display_view_details_btn();
437 437
 			}
438 438
 		}
439 439
 		return '';
@@ -465,13 +465,13 @@  discard block
 block discarded – undo
465 465
 	 * 	@return		string
466 466
 	 */
467 467
 	public static function display_view_details_btn() {
468
-		if ( ! self::$_event->get_permalink() ) {
469
-			EE_Error::add_error( __('The URL for the Event Details page could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
468
+		if ( ! self::$_event->get_permalink()) {
469
+			EE_Error::add_error(__('The URL for the Event Details page could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
470 470
 		}
471
-		$view_details_btn = '<form method="POST" action="' . self::$_event->get_permalink() . '">';
472
-		$btn_text = apply_filters( 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', __( 'View Details', 'event_espresso' ), self::$_event );
473
-		$view_details_btn .= '<input id="ticket-selector-submit-'. self::$_event->ID() .'-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="' . $btn_text . '" />';
474
-		$view_details_btn .= apply_filters( 'FHEE__EE_Ticket_Selector__after_view_details_btn', '', self::$_event );
471
+		$view_details_btn = '<form method="POST" action="'.self::$_event->get_permalink().'">';
472
+		$btn_text = apply_filters('FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', __('View Details', 'event_espresso'), self::$_event);
473
+		$view_details_btn .= '<input id="ticket-selector-submit-'.self::$_event->ID().'-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="'.$btn_text.'" />';
474
+		$view_details_btn .= apply_filters('FHEE__EE_Ticket_Selector__after_view_details_btn', '', self::$_event);
475 475
 		$view_details_btn .= '<div class="clear"><br/></div>';
476 476
 		$view_details_btn .= '</form>';
477 477
 		return $view_details_btn;
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 	 * 	@return		array  or FALSE
491 491
 	 */
492 492
 	public function process_ticket_selections() {
493
-		do_action( 'EED_Ticket_Selector__process_ticket_selections__before' );
493
+		do_action('EED_Ticket_Selector__process_ticket_selections__before');
494 494
 		// check nonce
495
-		if ( ! is_admin() && ( ! EE_Registry::instance()->REQ->is_set( 'process_ticket_selections_nonce' ) || ! wp_verify_nonce( EE_Registry::instance()->REQ->get( 'process_ticket_selections_nonce' ), 'process_ticket_selections' ))) {
495
+		if ( ! is_admin() && ( ! EE_Registry::instance()->REQ->is_set('process_ticket_selections_nonce') || ! wp_verify_nonce(EE_Registry::instance()->REQ->get('process_ticket_selections_nonce'), 'process_ticket_selections'))) {
496 496
 			EE_Error::add_error(
497
-				sprintf( __( 'We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ),
497
+				sprintf(__('We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'),
498 498
 				__FILE__, __FUNCTION__, __LINE__
499 499
 			);
500 500
 			return FALSE;
@@ -508,16 +508,16 @@  discard block
 block discarded – undo
508 508
 
509 509
 		//we should really only have 1 registration in the works now (ie, no MER) so clear any previous items in the cart.
510 510
 		// When MER happens this will probably need to be tweaked, possibly wrapped in a conditional checking for some constant defined in MER etc.
511
-		EE_Registry::instance()->load_core( 'Session' );
511
+		EE_Registry::instance()->load_core('Session');
512 512
 		// unless otherwise requested, clear the session
513
-		if ( apply_filters( 'FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', TRUE )) {
514
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
513
+		if (apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', TRUE)) {
514
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
515 515
 		}
516 516
 		//d( EE_Registry::instance()->SSN );
517 517
 
518
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
518
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
519 519
 		// do we have an event id?
520
-		if ( EE_Registry::instance()->REQ->is_set( 'tkt-slctr-event-id' ) ) {
520
+		if (EE_Registry::instance()->REQ->is_set('tkt-slctr-event-id')) {
521 521
 			// validate/sanitize data
522 522
 			$valid = self::_validate_post_data();
523 523
 
@@ -527,41 +527,41 @@  discard block
 block discarded – undo
527 527
 			//EEH_Debug_Tools::printr( $valid[ 'max_atndz' ], 'max_atndz', __FILE__, __LINE__ );
528 528
 
529 529
 			//check total tickets ordered vs max number of attendees that can register
530
-			if ( $valid['total_tickets'] > $valid['max_atndz'] ) {
530
+			if ($valid['total_tickets'] > $valid['max_atndz']) {
531 531
 
532 532
 				// ordering too many tickets !!!
533 533
 				$total_tickets_string = _n('You have attempted to purchase %s ticket.', 'You have attempted to purchase %s tickets.', $valid['total_tickets'], 'event_espresso');
534
-				$limit_error_1 = sprintf( $total_tickets_string, $valid['total_tickets'] );
534
+				$limit_error_1 = sprintf($total_tickets_string, $valid['total_tickets']);
535 535
 				// dev only message
536 536
 				$max_atndz_string = _n('The registration limit for this event is %s ticket per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.', 'The registration limit for this event is %s tickets per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.', $valid['max_atndz'], 'event_espresso');
537
-				$limit_error_2 = sprintf( $max_atndz_string, $valid['max_atndz'], $valid['max_atndz'] );
538
-				EE_Error::add_error( $limit_error_1 . '<br/>' . $limit_error_2, __FILE__, __FUNCTION__, __LINE__ );
537
+				$limit_error_2 = sprintf($max_atndz_string, $valid['max_atndz'], $valid['max_atndz']);
538
+				EE_Error::add_error($limit_error_1.'<br/>'.$limit_error_2, __FILE__, __FUNCTION__, __LINE__);
539 539
 			} else {
540 540
 
541 541
 				// all data appears to be valid
542 542
 				$tckts_slctd = FALSE;
543 543
 				$success = TRUE;
544 544
 				// load cart
545
-				EE_Registry::instance()->load_core( 'Cart' );
545
+				EE_Registry::instance()->load_core('Cart');
546 546
 
547 547
 				// cycle thru the number of data rows sent from the event listing
548
-				for ( $x = 0; $x < $valid['rows']; $x++ ) {
548
+				for ($x = 0; $x < $valid['rows']; $x++) {
549 549
 					// does this row actually contain a ticket quantity?
550
-					if ( isset( $valid['qty'][$x] ) && $valid['qty'][$x] > 0 ) {
550
+					if (isset($valid['qty'][$x]) && $valid['qty'][$x] > 0) {
551 551
 						// YES we have a ticket quantity
552 552
 						$tckts_slctd = TRUE;
553 553
 						//						d( $valid['ticket_obj'][$x] );
554
-						if ( $valid['ticket_obj'][$x] instanceof EE_Ticket ) {
554
+						if ($valid['ticket_obj'][$x] instanceof EE_Ticket) {
555 555
 							// then add ticket to cart
556
-							$ticket_added = self::_add_ticket_to_cart( $valid['ticket_obj'][$x], $valid['qty'][$x] );
556
+							$ticket_added = self::_add_ticket_to_cart($valid['ticket_obj'][$x], $valid['qty'][$x]);
557 557
 							$success = ! $ticket_added ? FALSE : $success;
558
-							if ( EE_Error::has_error() ) {
558
+							if (EE_Error::has_error()) {
559 559
 								break;
560 560
 							}
561 561
 						} else {
562 562
 							// nothing added to cart retrieved
563 563
 							EE_Error::add_error(
564
-								sprintf( __( 'A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ),
564
+								sprintf(__('A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'),
565 565
 								__FILE__, __FUNCTION__, __LINE__
566 566
 							);
567 567
 						}
@@ -570,45 +570,45 @@  discard block
 block discarded – undo
570 570
 				//d( EE_Registry::instance()->CART );
571 571
 				//die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL REDIRECT HERE BEFORE CART UPDATE
572 572
 
573
-				if ( $tckts_slctd ) {
574
-					if ( $success ) {
575
-						do_action( 'FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout', EE_Registry::instance()->CART, $this );
573
+				if ($tckts_slctd) {
574
+					if ($success) {
575
+						do_action('FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout', EE_Registry::instance()->CART, $this);
576 576
 						EE_Registry::instance()->CART->recalculate_all_cart_totals();
577
-						EE_Registry::instance()->CART->save_cart( FALSE );
577
+						EE_Registry::instance()->CART->save_cart(FALSE);
578 578
 						EE_Registry::instance()->SSN->update();
579 579
 						//d( EE_Registry::instance()->CART );
580 580
 						//die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< OR HERE TO KILL REDIRECT AFTER CART UPDATE
581 581
 						// just return TRUE for registrations being made from admin
582
-						if ( is_admin() ) {
582
+						if (is_admin()) {
583 583
 							return TRUE;
584 584
 						}
585
-						wp_safe_redirect( apply_filters( 'FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url', EE_Registry::instance()->CFG->core->reg_page_url() ));
585
+						wp_safe_redirect(apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url', EE_Registry::instance()->CFG->core->reg_page_url()));
586 586
 						exit();
587 587
 
588 588
 					} else {
589
-						if ( ! EE_Error::has_error() ) {
589
+						if ( ! EE_Error::has_error()) {
590 590
 							// nothing added to cart
591
-							EE_Error::add_attention( __( 'No tickets were added for the event', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
591
+							EE_Error::add_attention(__('No tickets were added for the event', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
592 592
 						}
593 593
 					}
594 594
 
595 595
 				} else {
596 596
 					// no ticket quantities were selected
597
-					EE_Error::add_error( __( 'You need to select a ticket quantity before you can proceed.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
597
+					EE_Error::add_error(__('You need to select a ticket quantity before you can proceed.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
598 598
 				}
599 599
 			}
600 600
 			//die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL BEFORE REDIRECT
601 601
 			// at this point, just return if registration is being made from admin
602
-			if ( is_admin() ) {
602
+			if (is_admin()) {
603 603
 				return FALSE;
604 604
 			}
605
-			if ( $valid['return_url'] ) {
606
-				EE_Error::get_notices( FALSE, TRUE );
607
-				wp_safe_redirect( $valid['return_url'] );
605
+			if ($valid['return_url']) {
606
+				EE_Error::get_notices(FALSE, TRUE);
607
+				wp_safe_redirect($valid['return_url']);
608 608
 				exit();
609
-			} elseif ( isset( $event_to_add['id'] )) {
610
-				EE_Error::get_notices( FALSE, TRUE );
611
-				wp_safe_redirect( get_permalink( $event_to_add['id'] ));
609
+			} elseif (isset($event_to_add['id'])) {
610
+				EE_Error::get_notices(FALSE, TRUE);
611
+				wp_safe_redirect(get_permalink($event_to_add['id']));
612 612
 				exit();
613 613
 			} else {
614 614
 				echo EE_Error::get_notices();
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 		} else {
618 618
 			// $_POST['tkt-slctr-event-id'] was not set ?!?!?!?
619 619
 			EE_Error::add_error(
620
-				sprintf( __( 'An event id was not provided or was not received.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ),
620
+				sprintf(__('An event id was not provided or was not received.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'),
621 621
 				__FILE__, __FUNCTION__, __LINE__
622 622
 			);
623 623
 		}
@@ -635,18 +635,18 @@  discard block
 block discarded – undo
635 635
 	 * @return        array  or FALSE
636 636
 	 */
637 637
 	private static function _validate_post_data() {
638
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
638
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
639 639
 
640 640
 		// start with an empty array()
641 641
 		$valid_data = array();
642 642
 		//		d( $_POST );
643 643
 		//if event id is valid
644
-		$id = absint( EE_Registry::instance()->REQ->get( 'tkt-slctr-event-id' ));
645
-		if ( $id ) {
644
+		$id = absint(EE_Registry::instance()->REQ->get('tkt-slctr-event-id'));
645
+		if ($id) {
646 646
 			// grab valid id
647 647
 			$valid_data['id'] = $id;
648 648
 			// grab and sanitize return-url
649
-			$valid_data['return_url'] = esc_url_raw( EE_Registry::instance()->REQ->get( 'tkt-slctr-return-url-' . $id ));
649
+			$valid_data['return_url'] = esc_url_raw(EE_Registry::instance()->REQ->get('tkt-slctr-return-url-'.$id));
650 650
 			// array of other form names
651 651
 			$inputs_to_clean = array(
652 652
 				'event_id' => 'tkt-slctr-event-id',
@@ -659,22 +659,22 @@  discard block
 block discarded – undo
659 659
 			// let's track the total number of tickets ordered.'
660 660
 			$valid_data['total_tickets'] = 0;
661 661
 			// cycle through $inputs_to_clean array
662
-			foreach ( $inputs_to_clean as $what => $input_to_clean ) {
662
+			foreach ($inputs_to_clean as $what => $input_to_clean) {
663 663
 				// check for POST data
664
-				if ( EE_Registry::instance()->REQ->is_set( $input_to_clean . $id )) {
664
+				if (EE_Registry::instance()->REQ->is_set($input_to_clean.$id)) {
665 665
 					// grab value
666
-					$input_value = EE_Registry::instance()->REQ->get( $input_to_clean . $id );
666
+					$input_value = EE_Registry::instance()->REQ->get($input_to_clean.$id);
667 667
 					switch ($what) {
668 668
 
669 669
 						// integers
670 670
 						case 'event_id':
671
-							$valid_data[$what] = absint( $input_value );
671
+							$valid_data[$what] = absint($input_value);
672 672
 							// get event via the event id we put in the form
673
-							$valid_data['event'] = EE_Registry::instance()->load_model( 'Event' )->get_one_by_ID( $valid_data['event_id'] );
673
+							$valid_data['event'] = EE_Registry::instance()->load_model('Event')->get_one_by_ID($valid_data['event_id']);
674 674
 							break;
675 675
 						case 'rows':
676 676
 						case 'max_atndz':
677
-							$valid_data[$what] = absint( $input_value );
677
+							$valid_data[$what] = absint($input_value);
678 678
 							break;
679 679
 
680 680
 						// arrays of integers
@@ -682,27 +682,27 @@  discard block
 block discarded – undo
682 682
 							//							d( $input_value );
683 683
 							$row_qty = $input_value;
684 684
 							// if qty is coming from a radio button input, then we need to assemble an array of rows
685
-							if( ! is_array( $row_qty )) {
685
+							if ( ! is_array($row_qty)) {
686 686
 								// get number of rows
687
-								$rows = EE_Registry::instance()->REQ->is_set( 'tkt-slctr-rows-' . $id ) ? absint( EE_Registry::instance()->REQ->get( 'tkt-slctr-rows-' . $id )) : 1;
687
+								$rows = EE_Registry::instance()->REQ->is_set('tkt-slctr-rows-'.$id) ? absint(EE_Registry::instance()->REQ->get('tkt-slctr-rows-'.$id)) : 1;
688 688
 								//								d( $rows );
689 689
 								// explode ints by the dash
690
-								$row_qty = explode( '-', $row_qty );
691
-								$row = isset( $row_qty[0] ) ? ( absint( $row_qty[0] )) : 1;
692
-								$qty = isset( $row_qty[1] ) ? absint( $row_qty[1] ) : 0;
693
-								$row_qty = array( $row => $qty );
690
+								$row_qty = explode('-', $row_qty);
691
+								$row = isset($row_qty[0]) ? (absint($row_qty[0])) : 1;
692
+								$qty = isset($row_qty[1]) ? absint($row_qty[1]) : 0;
693
+								$row_qty = array($row => $qty);
694 694
 								//								 d( $row_qty );
695
-								for( $x = 1; $x <= $rows; $x++ ) {
696
-									if ( ! isset( $row_qty[$x] )) {
695
+								for ($x = 1; $x <= $rows; $x++) {
696
+									if ( ! isset($row_qty[$x])) {
697 697
 										$row_qty[$x] = 0;
698 698
 									}
699 699
 								}
700 700
 							}
701
-							ksort( $row_qty );
701
+							ksort($row_qty);
702 702
 							//							 d( $row_qty );
703 703
 							// cycle thru values
704
-							foreach ( $row_qty as $qty ) {
705
-								$qty = absint( $qty );
704
+							foreach ($row_qty as $qty) {
705
+								$qty = absint($qty);
706 706
 								// sanitize as integers
707 707
 								$valid_data[$what][] = $qty;
708 708
 								$valid_data['total_tickets'] += $qty;
@@ -713,19 +713,19 @@  discard block
 block discarded – undo
713 713
 						case 'ticket_id':
714 714
 							$value_array = array();
715 715
 							// cycle thru values
716
-							foreach ( $input_value as $key=>$value ) {
716
+							foreach ($input_value as $key=>$value) {
717 717
 								// allow only numbers, letters,  spaces, commas and dashes
718
-								$value_array[ $key ] = wp_strip_all_tags( $value );
718
+								$value_array[$key] = wp_strip_all_tags($value);
719 719
 								// get ticket via the ticket id we put in the form
720
-								$ticket_obj = EE_Registry::instance()->load_model( 'Ticket' )->get_one_by_ID( $value );
721
-								$valid_data['ticket_obj'][ $key ] = $ticket_obj;
720
+								$ticket_obj = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($value);
721
+								$valid_data['ticket_obj'][$key] = $ticket_obj;
722 722
 							}
723
-							$valid_data[ $what ] = $value_array;
723
+							$valid_data[$what] = $value_array;
724 724
 							break;
725 725
 
726 726
 						case 'return_url' :
727 727
 							// grab and sanitize return-url
728
-							$valid_data[$what] = esc_url_raw( $input_value );
728
+							$valid_data[$what] = esc_url_raw($input_value);
729 729
 							break;
730 730
 
731 731
 					} 	// end switch $what
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 			} 	// end foreach $inputs_to_clean
734 734
 
735 735
 		} else {
736
-			EE_Error::add_error( __('The event id provided was not valid.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
736
+			EE_Error::add_error(__('The event id provided was not valid.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
737 737
 			return FALSE;
738 738
 		}
739 739
 
@@ -751,28 +751,28 @@  discard block
 block discarded – undo
751 751
 	 * @param int       $qty
752 752
 	 * @return TRUE on success, FALSE on fail
753 753
 	 */
754
-	private static function _add_ticket_to_cart( EE_Ticket $ticket = NULL, $qty = 1 ) {
755
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
754
+	private static function _add_ticket_to_cart(EE_Ticket $ticket = NULL, $qty = 1) {
755
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
756 756
 		// get the number of spaces left for this datetime ticket
757
-		$available_spaces = self::_ticket_datetime_availability( $ticket );
757
+		$available_spaces = self::_ticket_datetime_availability($ticket);
758 758
 		// compare available spaces against the number of tickets being purchased
759
-		if ( $available_spaces >= $qty ) {
759
+		if ($available_spaces >= $qty) {
760 760
 			// allow addons to prevent a ticket from being added to cart
761
-			if ( ! apply_filters( 'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart', true, $ticket, $qty, $available_spaces ) ) {
761
+			if ( ! apply_filters('FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart', true, $ticket, $qty, $available_spaces)) {
762 762
 				return false;
763 763
 			}
764 764
 			// add event to cart
765
-			if( EE_Registry::instance()->CART->add_ticket_to_cart( $ticket, $qty )) {
766
-				self::_recalculate_ticket_datetime_availability( $ticket, $qty );
765
+			if (EE_Registry::instance()->CART->add_ticket_to_cart($ticket, $qty)) {
766
+				self::_recalculate_ticket_datetime_availability($ticket, $qty);
767 767
 				return true;
768 768
 			} else {
769 769
 				return false;
770 770
 			}
771 771
 		} else {
772 772
 			// tickets can not be purchased but let's find the exact number left for the last ticket selected PRIOR to subtracting tickets
773
-			$available_spaces = self::_ticket_datetime_availability( $ticket, true );
773
+			$available_spaces = self::_ticket_datetime_availability($ticket, true);
774 774
 			// greedy greedy greedy eh?
775
-			if ( $available_spaces > 0 ) {
775
+			if ($available_spaces > 0) {
776 776
 				// add error messaging - we're using the _n function that will generate the appropriate singular or plural message based on the number of $available_spaces
777 777
 				EE_Error::add_error(
778 778
 					sprintf(
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 					__FILE__, __FUNCTION__, __LINE__
789 789
 				);
790 790
 			} else {
791
-				EE_Error::add_error( __('We\'re sorry, but there are no available spaces left for this event at this particular date and time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
791
+				EE_Error::add_error(__('We\'re sorry, but there are no available spaces left for this event at this particular date and time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
792 792
 			}
793 793
 			return false;
794 794
 		}
@@ -806,22 +806,22 @@  discard block
 block discarded – undo
806 806
 	 * @param 	bool         $get_original_ticket_spaces
807 807
 	 * @return 	int
808 808
 	 */
809
-	private static function _ticket_datetime_availability( EE_Ticket $ticket, $get_original_ticket_spaces = FALSE ) {
809
+	private static function _ticket_datetime_availability(EE_Ticket $ticket, $get_original_ticket_spaces = FALSE) {
810 810
 		// if the $_available_spaces array has not been set up yet...
811
-		if ( ! isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) {
812
-				self::_set_initial_ticket_datetime_availability( $ticket );
811
+		if ( ! isset(self::$_available_spaces['tickets'][$ticket->ID()])) {
812
+				self::_set_initial_ticket_datetime_availability($ticket);
813 813
 		}
814 814
 		$available_spaces = $ticket->qty() - $ticket->sold();
815
-		if ( isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) {
815
+		if (isset(self::$_available_spaces['tickets'][$ticket->ID()])) {
816 816
 			// loop thru tickets, which will ALSO include individual ticket records AND a total
817
-			foreach ( self::$_available_spaces['tickets'][ $ticket->ID() ] as $DTD_ID => $spaces  ) {
817
+			foreach (self::$_available_spaces['tickets'][$ticket->ID()] as $DTD_ID => $spaces) {
818 818
 				// if we want the original datetime availability BEFORE we started subtracting tickets ?
819
-				if ( $get_original_ticket_spaces ) {
819
+				if ($get_original_ticket_spaces) {
820 820
 					// then grab the available spaces from the "tickets" array and compare with the above to get the lowest number
821
-					$available_spaces = min( $available_spaces, self::$_available_spaces['tickets'][ $ticket->ID() ][ $DTD_ID ] );
821
+					$available_spaces = min($available_spaces, self::$_available_spaces['tickets'][$ticket->ID()][$DTD_ID]);
822 822
 				} else {
823 823
 					// we want the updated ticket availability as stored in the "datetimes" array
824
-					$available_spaces = min( $available_spaces, self::$_available_spaces['datetimes'][ $DTD_ID ] );
824
+					$available_spaces = min($available_spaces, self::$_available_spaces['datetimes'][$DTD_ID]);
825 825
 				}
826 826
 			}
827 827
 		}
@@ -837,23 +837,23 @@  discard block
 block discarded – undo
837 837
 	 * @param 	EE_Ticket $ticket
838 838
 	 * @return 	int
839 839
 	 */
840
-	private static function _set_initial_ticket_datetime_availability( EE_Ticket $ticket ) {
840
+	private static function _set_initial_ticket_datetime_availability(EE_Ticket $ticket) {
841 841
 		// first, get all of the datetimes that are available to this ticket
842 842
 		$datetimes = $ticket->get_many_related(
843 843
 			'Datetime',
844
-			array( array( 'DTT_EVT_end' => array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) ) ), 'order_by' => array( 'DTT_EVT_start' => 'ASC' ))
844
+			array(array('DTT_EVT_end' => array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'))), 'order_by' => array('DTT_EVT_start' => 'ASC'))
845 845
 		);
846
-		if ( ! empty( $datetimes )) {
846
+		if ( ! empty($datetimes)) {
847 847
 			// now loop thru all of the datetimes
848
-			foreach ( $datetimes as $datetime  ) {
849
-				if ( $datetime instanceof EE_Datetime ) {
848
+			foreach ($datetimes as $datetime) {
849
+				if ($datetime instanceof EE_Datetime) {
850 850
 					// the number of spaces available for the datetime without considering individual ticket quantities
851 851
 					$spaces_remaining = $datetime->spaces_remaining();
852 852
 					// save the total available spaces ( the lesser of the ticket qty minus the number of tickets sold or the datetime spaces remaining) to this ticket using the datetime ID as the key
853
-					self::$_available_spaces['tickets'][ $ticket->ID() ][ $datetime->ID() ] = min(( $ticket->qty() - $ticket->sold() ), $spaces_remaining );
853
+					self::$_available_spaces['tickets'][$ticket->ID()][$datetime->ID()] = min(($ticket->qty() - $ticket->sold()), $spaces_remaining);
854 854
 					// if the remaining spaces for this datetime is already set, then compare that against the datetime spaces remaining, and take the lowest number,
855 855
 					// else just take the datetime spaces remaining, and assign to the datetimes array
856
-					self::$_available_spaces['datetimes'][ $datetime->ID() ] = isset( self::$_available_spaces['datetimes'][ $datetime->ID() ] ) ? min( self::$_available_spaces['datetimes'][ $datetime->ID() ], $spaces_remaining ) : $spaces_remaining;
856
+					self::$_available_spaces['datetimes'][$datetime->ID()] = isset(self::$_available_spaces['datetimes'][$datetime->ID()]) ? min(self::$_available_spaces['datetimes'][$datetime->ID()], $spaces_remaining) : $spaces_remaining;
857 857
 				}
858 858
 			}
859 859
 		}
@@ -869,12 +869,12 @@  discard block
 block discarded – undo
869 869
 	 * @param 	int   $qty
870 870
 	 * @return 	int
871 871
 	 */
872
-	private static function _recalculate_ticket_datetime_availability( EE_Ticket $ticket, $qty = 0 ) {
873
-		if ( isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) {
872
+	private static function _recalculate_ticket_datetime_availability(EE_Ticket $ticket, $qty = 0) {
873
+		if (isset(self::$_available_spaces['tickets'][$ticket->ID()])) {
874 874
 			// loop thru tickets, which will ALSO include individual ticket records AND a total
875
-			foreach ( self::$_available_spaces['tickets'][ $ticket->ID() ] as $DTD_ID => $spaces  ) {
875
+			foreach (self::$_available_spaces['tickets'][$ticket->ID()] as $DTD_ID => $spaces) {
876 876
 				// subtract the qty of selected tickets from each datetime's available spaces this ticket has access to,
877
-				self::$_available_spaces['datetimes'][ $DTD_ID ] = self::$_available_spaces['datetimes'][ $DTD_ID ] - $qty;
877
+				self::$_available_spaces['datetimes'][$DTD_ID] = self::$_available_spaces['datetimes'][$DTD_ID] - $qty;
878 878
 			}
879 879
 		}
880 880
 	}
@@ -891,8 +891,8 @@  discard block
 block discarded – undo
891 891
 	*/
892 892
 	public static function load_tckt_slctr_assets() {
893 893
 		// add some style
894
-		if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) {
895
-			wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css');
894
+		if (apply_filters('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE)) {
895
+			wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css');
896 896
 			wp_enqueue_style('ticket_selector');
897 897
 			// make it dance
898 898
 			//			wp_register_script('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', array('espresso_core'), '', TRUE);
@@ -906,9 +906,9 @@  discard block
 block discarded – undo
906 906
 
907 907
 	public static function load_tckt_slctr_assets_admin() {
908 908
 		//iframe button js on admin event editor page
909
-		if ( EE_Registry::instance()->REQ->get('page') == 'espresso_events' && EE_Registry::instance()->REQ->get('action') == 'edit' ) {
910
-			wp_register_script( 'ticket_selector_embed', TICKET_SELECTOR_ASSETS_URL . 'ticket-selector-embed.js', array( 'ee-dialog' ), EVENT_ESPRESSO_VERSION, true );
911
-			wp_enqueue_script( 'ticket_selector_embed' );
909
+		if (EE_Registry::instance()->REQ->get('page') == 'espresso_events' && EE_Registry::instance()->REQ->get('action') == 'edit') {
910
+			wp_register_script('ticket_selector_embed', TICKET_SELECTOR_ASSETS_URL.'ticket-selector-embed.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, true);
911
+			wp_enqueue_script('ticket_selector_embed');
912 912
 		}
913 913
 	}
914 914
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
core/db_classes/EE_Venue.class.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 *                             		    date_format and the second value is the time format
38 38
 	 * @return EE_Attendee
39 39
 	 */
40
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
41
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
42
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
40
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
41
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
42
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
43 43
 	}
44 44
 
45 45
 
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 *                          		the website will be used.
51 51
 	 * @return EE_Attendee
52 52
 	 */
53
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
54
-		return new self( $props_n_values, TRUE, $timezone );
53
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
54
+		return new self($props_n_values, TRUE, $timezone);
55 55
 	}
56 56
 
57 57
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 * @return string
62 62
 	 */
63 63
 	function name() {
64
-		return $this->get( 'VNU_name' );
64
+		return $this->get('VNU_name');
65 65
 	}
66 66
 
67 67
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @return string
71 71
 	 */
72 72
 	function phone() {
73
-		return $this->get( 'VNU_phone' );
73
+		return $this->get('VNU_phone');
74 74
 	}
75 75
 
76 76
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 * @return string
81 81
 	 */
82 82
 	function venue_url() {
83
-		return $this->get( 'VNU_url' );
83
+		return $this->get('VNU_url');
84 84
 	}
85 85
 
86 86
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @return string
90 90
 	 */
91 91
 	function description() {
92
-		return $this->get( 'VNU_desc' );
92
+		return $this->get('VNU_desc');
93 93
 	}
94 94
 
95 95
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return string
100 100
 	 */
101 101
 	function excerpt() {
102
-		return $this->get( 'VNU_short_desc' );
102
+		return $this->get('VNU_short_desc');
103 103
 	}
104 104
 
105 105
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @return string
110 110
 	 */
111 111
 	function identifier() {
112
-		return $this->get( 'VNU_identifier' );
112
+		return $this->get('VNU_identifier');
113 113
 	}
114 114
 
115 115
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * @return string
120 120
 	 */
121 121
 	function address() {
122
-		return $this->get( 'VNU_address' );
122
+		return $this->get('VNU_address');
123 123
 	}
124 124
 
125 125
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 * @return string
130 130
 	 */
131 131
 	function address2() {
132
-		return $this->get( 'VNU_address2' );
132
+		return $this->get('VNU_address2');
133 133
 	}
134 134
 
135 135
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @return string
141 141
 	 */
142 142
 	function city() {
143
-		return $this->get( 'VNU_city' );
143
+		return $this->get('VNU_city');
144 144
 	}
145 145
 
146 146
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @return int
149 149
 	 */
150 150
 	function state_ID() {
151
-		return $this->get( 'STA_ID' );
151
+		return $this->get('STA_ID');
152 152
 	}
153 153
 
154 154
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * @return string
167 167
 	 */
168 168
 	public function state_name() {
169
-		return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() :  '';
169
+		return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : '';
170 170
 	}
171 171
 
172 172
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 * @return EE_State
177 177
 	 */
178 178
 	function state_obj() {
179
-		return $this->get_first_related( 'State' );
179
+		return $this->get_first_related('State');
180 180
 	}
181 181
 
182 182
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 * @return string
189 189
 	 */
190 190
 	public function state() {
191
-		if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) {
191
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
192 192
 			return $this->state_abbrev();
193 193
 		} else {
194 194
 			return $this->state_name();
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	 * @return string
203 203
 	 */
204 204
 	function country_ID() {
205
-		return $this->get( 'CNT_ISO' );
205
+		return $this->get('CNT_ISO');
206 206
 	}
207 207
 
208 208
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 * @return string
212 212
 	 */
213 213
 	public function country_name() {
214
-		return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() :  '';
214
+		return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : '';
215 215
 	}
216 216
 
217 217
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @return EE_Country
222 222
 	 */
223 223
 	function country_obj() {
224
-		return $this->get_first_related( 'Country' );
224
+		return $this->get_first_related('Country');
225 225
 	}
226 226
 
227 227
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 * @return string
234 234
 	 */
235 235
 	public function country() {
236
-		if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) {
236
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
237 237
 			return $this->country_ID();
238 238
 		} else {
239 239
 			return $this->country_name();
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 * @return string
248 248
 	 */
249 249
 	function zip() {
250
-		return $this->get( 'VNU_zip' );
250
+		return $this->get('VNU_zip');
251 251
 	}
252 252
 
253 253
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 * @return int
258 258
 	 */
259 259
 	function capacity() {
260
-		return $this->get_pretty( 'VNU_capacity', 'symbol' );
260
+		return $this->get_pretty('VNU_capacity', 'symbol');
261 261
 	}
262 262
 
263 263
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @return string
268 268
 	 */
269 269
 	function created() {
270
-		return $this->get( 'VNU_created' );
270
+		return $this->get('VNU_created');
271 271
 	}
272 272
 
273 273
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	 * @return string
278 278
 	 */
279 279
 	function modified() {
280
-		return $this->get( 'VNU_modified' );
280
+		return $this->get('VNU_modified');
281 281
 	}
282 282
 
283 283
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	 * @return int
288 288
 	 */
289 289
 	function order() {
290
-		return $this->get( 'VNU_order' );
290
+		return $this->get('VNU_order');
291 291
 	}
292 292
 
293 293
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 * @return int
298 298
 	 */
299 299
 	function wp_user() {
300
-		return $this->get( 'VNU_wp_user' );
300
+		return $this->get('VNU_wp_user');
301 301
 	}
302 302
 
303 303
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * @return string
307 307
 	 */
308 308
 	function virtual_phone() {
309
-		return $this->get( 'VNU_virtual_phone' );
309
+		return $this->get('VNU_virtual_phone');
310 310
 	}
311 311
 
312 312
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 * @return string
316 316
 	 */
317 317
 	function virtual_url() {
318
-		return $this->get( 'VNU_virtual_url' );
318
+		return $this->get('VNU_virtual_url');
319 319
 	}
320 320
 
321 321
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 	 * @return bool
325 325
 	 */
326 326
 	function enable_for_gmap() {
327
-		return $this->get( 'VNU_enable_for_gmap' );
327
+		return $this->get('VNU_enable_for_gmap');
328 328
 	}
329 329
 
330 330
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 	 * @return string
334 334
 	 */
335 335
 	function google_map_link() {
336
-		return $this->get( 'VNU_google_map_link' );
336
+		return $this->get('VNU_google_map_link');
337 337
 	}
338 338
 
339 339
 
@@ -345,16 +345,16 @@  discard block
 block discarded – undo
345 345
 	 * @param bool  $upcoming
346 346
 	 * @return EE_Event[]
347 347
 	 */
348
-	function events( $query_params = array(), $upcoming = FALSE ) {
349
-		if ( $upcoming ) {
348
+	function events($query_params = array(), $upcoming = FALSE) {
349
+		if ($upcoming) {
350 350
 			$query_params = array(
351 351
 				array(
352 352
 					'status' => 'publish',
353
-					'Datetime.DTT_EVT_start' => array( '>',  EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_start' ) )
353
+					'Datetime.DTT_EVT_start' => array('>', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'))
354 354
 				)
355 355
 			);
356 356
 		}
357
-		return $this->get_many_related( 'Event', $query_params );
357
+		return $this->get_many_related('Event', $query_params);
358 358
 	}
359 359
 
360 360
 
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
 	/**
373 373
 	 * Sets address
374 374
 	 */
375
-	function set_address( $address = '' ) {
376
-		$this->set( 'VNU_address', $address );
375
+	function set_address($address = '') {
376
+		$this->set('VNU_address', $address);
377 377
 	}
378 378
 
379 379
 
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 	/**
382 382
 	 * @param string $address2
383 383
 	 */
384
-	function set_address2( $address2 = '' ) {
385
-		$this->set( 'VNU_address2', $address2 );
384
+	function set_address2($address2 = '') {
385
+		$this->set('VNU_address2', $address2);
386 386
 	}
387 387
 
388 388
 
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
 	/**
391 391
 	 * @param string $city
392 392
 	 */
393
-	function set_city( $city = '' ) {
394
-		$this->set( 'VNU_city', $city );
393
+	function set_city($city = '') {
394
+		$this->set('VNU_city', $city);
395 395
 	}
396 396
 
397 397
 
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
 	/**
400 400
 	 * @param int $state
401 401
 	 */
402
-	function set_state_ID( $state = 0 ) {
403
-		$this->set( 'STA_ID', $state );
402
+	function set_state_ID($state = 0) {
403
+		$this->set('STA_ID', $state);
404 404
 	}
405 405
 
406 406
 
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
 	 * @param EE_State /int $state_id_or_obj
412 412
 	 * @return EE_State
413 413
 	 */
414
-	function set_state_obj( $state_id_or_obj ) {
415
-		return $this->_add_relation_to( $state_id_or_obj, 'State' );
414
+	function set_state_obj($state_id_or_obj) {
415
+		return $this->_add_relation_to($state_id_or_obj, 'State');
416 416
 	}
417 417
 
418 418
 
@@ -420,8 +420,8 @@  discard block
 block discarded – undo
420 420
 	/**
421 421
 	 * @param int $country_ID
422 422
 	 */
423
-	function set_country_ID( $country_ID = 0 ) {
424
-		$this->set( 'CNT_ISO', $country_ID );
423
+	function set_country_ID($country_ID = 0) {
424
+		$this->set('CNT_ISO', $country_ID);
425 425
 	}
426 426
 
427 427
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 	 * @param EE_Country /string $country_id_or_obj
431 431
 	 * @return EE_Country
432 432
 	 */
433
-	function set_country_obj( $country_id_or_obj ) {
433
+	function set_country_obj($country_id_or_obj) {
434 434
 		return $this->_add_relation_to($country_id_or_obj, 'Country');
435 435
 	}
436 436
 
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
 	/**
440 440
 	 * @param string $zip
441 441
 	 */
442
-	function set_zip( $zip = '' ) {
443
-		$this->set( 'VNU_zip', $zip );
442
+	function set_zip($zip = '') {
443
+		$this->set('VNU_zip', $zip);
444 444
 	}
445 445
 
446 446
 
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 	/**
449 449
 	 * @param int $capacity
450 450
 	 */
451
-	function set_capacity( $capacity = 0 ) {
452
-		$this->set( 'VNU_capacity', $capacity );
451
+	function set_capacity($capacity = 0) {
452
+		$this->set('VNU_capacity', $capacity);
453 453
 	}
454 454
 
455 455
 
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
 	/**
458 458
 	 * @param string $created
459 459
 	 */
460
-	function set_created( $created = '' ) {
461
-		$this->set( 'VNU_created', $created );
460
+	function set_created($created = '') {
461
+		$this->set('VNU_created', $created);
462 462
 	}
463 463
 
464 464
 
@@ -466,8 +466,8 @@  discard block
 block discarded – undo
466 466
 	/**
467 467
 	 * @param string $desc
468 468
 	 */
469
-	function set_description( $desc = '' ) {
470
-		$this->set( 'VNU_desc', $desc );
469
+	function set_description($desc = '') {
470
+		$this->set('VNU_desc', $desc);
471 471
 	}
472 472
 
473 473
 
@@ -475,8 +475,8 @@  discard block
 block discarded – undo
475 475
 	/**
476 476
 	 * @param string $identifier
477 477
 	 */
478
-	function set_identifier( $identifier = '' ) {
479
-		$this->set( 'VNU_identifier', $identifier );
478
+	function set_identifier($identifier = '') {
479
+		$this->set('VNU_identifier', $identifier);
480 480
 	}
481 481
 
482 482
 
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
 	/**
485 485
 	 * @param string $modified
486 486
 	 */
487
-	function set_modified( $modified = '' ) {
488
-		$this->set( 'VNU_modified', $modified );
487
+	function set_modified($modified = '') {
488
+		$this->set('VNU_modified', $modified);
489 489
 	}
490 490
 
491 491
 
@@ -493,8 +493,8 @@  discard block
 block discarded – undo
493 493
 	/**
494 494
 	 * @param string $name
495 495
 	 */
496
-	function set_name( $name = '' ) {
497
-		$this->set( 'VNU_name', $name );
496
+	function set_name($name = '') {
497
+		$this->set('VNU_name', $name);
498 498
 	}
499 499
 
500 500
 
@@ -502,8 +502,8 @@  discard block
 block discarded – undo
502 502
 	/**
503 503
 	 * @param int $order
504 504
 	 */
505
-	function set_order( $order = 0 ) {
506
-		$this->set( 'VNU_order', $order );
505
+	function set_order($order = 0) {
506
+		$this->set('VNU_order', $order);
507 507
 	}
508 508
 
509 509
 
@@ -511,8 +511,8 @@  discard block
 block discarded – undo
511 511
 	/**
512 512
 	 * @param string $phone
513 513
 	 */
514
-	function set_phone( $phone = '' ) {
515
-		$this->set( 'VNU_phone', $phone );
514
+	function set_phone($phone = '') {
515
+		$this->set('VNU_phone', $phone);
516 516
 	}
517 517
 
518 518
 
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
 	/**
521 521
 	 * @param int $wp_user
522 522
 	 */
523
-	function set_wp_user( $wp_user = 1 ) {
524
-		$this->set( 'VNU_wp_user', $wp_user );
523
+	function set_wp_user($wp_user = 1) {
524
+		$this->set('VNU_wp_user', $wp_user);
525 525
 	}
526 526
 
527 527
 
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
 	/**
530 530
 	 * @param string $url
531 531
 	 */
532
-	function set_venue_url( $url = '' ) {
533
-		$this->set( 'VNU_url', $url );
532
+	function set_venue_url($url = '') {
533
+		$this->set('VNU_url', $url);
534 534
 	}
535 535
 
536 536
 
@@ -538,8 +538,8 @@  discard block
 block discarded – undo
538 538
 	/**
539 539
 	 * @param string $phone
540 540
 	 */
541
-	function set_virtual_phone( $phone = '' ) {
542
-		$this->set( 'VNU_virtual_phone', $phone );
541
+	function set_virtual_phone($phone = '') {
542
+		$this->set('VNU_virtual_phone', $phone);
543 543
 	}
544 544
 
545 545
 
@@ -547,8 +547,8 @@  discard block
 block discarded – undo
547 547
 	/**
548 548
 	 * @param string $url
549 549
 	 */
550
-	function set_virtual_url( $url = '' ) {
551
-		$this->set( 'VNU_virtual_url', $url );
550
+	function set_virtual_url($url = '') {
551
+		$this->set('VNU_virtual_url', $url);
552 552
 	}
553 553
 
554 554
 
@@ -556,8 +556,8 @@  discard block
 block discarded – undo
556 556
 	/**
557 557
 	 * @param string $enable
558 558
 	 */
559
-	function set_enable_for_gmap( $enable = '' ) {
560
-		$this->set( 'VNU_enable_for_gmap', $enable );
559
+	function set_enable_for_gmap($enable = '') {
560
+		$this->set('VNU_enable_for_gmap', $enable);
561 561
 	}
562 562
 
563 563
 
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
 	/**
566 566
 	 * @param string $google_map_link
567 567
 	 */
568
-	function set_google_map_link( $google_map_link = '' ) {
569
-		$this->set( 'VNU_google_map_link', $google_map_link );
568
+	function set_google_map_link($google_map_link = '') {
569
+		$this->set('VNU_google_map_link', $google_map_link);
570 570
 	}
571 571
 
572 572
 
Please login to merge, or discard this patch.
core/db_classes/EE_Attendee.class.php 2 patches
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -33,20 +33,20 @@  discard block
 block discarded – undo
33 33
 	 * @param string $timezone
34 34
 	 * @param array $date_formats
35 35
 	 */
36
-	protected function __construct( $fieldValues = NULL, $bydb = FALSE, $timezone = NULL, $date_formats = array() ) {
37
-		if ( !isset( $fieldValues[ 'ATT_full_name' ] ) ) {
38
-			$fname = isset( $fieldValues[ 'ATT_fname' ] ) ? $fieldValues[ 'ATT_fname' ] . ' ' : '';
39
-			$lname = isset( $fieldValues[ 'ATT_lname' ] ) ? $fieldValues[ 'ATT_lname' ] : '';
40
-			$fieldValues[ 'ATT_full_name' ] = $fname . $lname;
36
+	protected function __construct($fieldValues = NULL, $bydb = FALSE, $timezone = NULL, $date_formats = array()) {
37
+		if ( ! isset($fieldValues['ATT_full_name'])) {
38
+			$fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'].' ' : '';
39
+			$lname = isset($fieldValues['ATT_lname']) ? $fieldValues['ATT_lname'] : '';
40
+			$fieldValues['ATT_full_name'] = $fname.$lname;
41 41
 		}
42
-		if ( !isset( $fieldValues[ 'ATT_slug' ] ) ) {
42
+		if ( ! isset($fieldValues['ATT_slug'])) {
43 43
 			//			$fieldValues['ATT_slug'] = sanitize_key(wp_generate_password(20));
44
-			$fieldValues[ 'ATT_slug' ] = sanitize_title( $fieldValues[ 'ATT_full_name' ] );
44
+			$fieldValues['ATT_slug'] = sanitize_title($fieldValues['ATT_full_name']);
45 45
 		}
46
-		if ( !isset( $fieldValues[ 'ATT_short_bio' ] ) && isset( $fieldValues[ 'ATT_bio' ] ) ) {
47
-			$fieldValues[ 'ATT_short_bio' ] = substr( $fieldValues[ 'ATT_bio' ], 0, 50 );
46
+		if ( ! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
47
+			$fieldValues['ATT_short_bio'] = substr($fieldValues['ATT_bio'], 0, 50);
48 48
 		}
49
-		parent::__construct( $fieldValues, $bydb, $timezone, $date_formats );
49
+		parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
50 50
 	}
51 51
 
52 52
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 *                             		    date_format and the second value is the time format
61 61
 	 * @return EE_Attendee
62 62
 	 */
63
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
64
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
65
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
63
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
64
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
65
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
66 66
 	}
67 67
 
68 68
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 *                          		the website will be used.
74 74
 	 * @return EE_Attendee
75 75
 	 */
76
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
77
-		return new self( $props_n_values, TRUE, $timezone );
76
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
77
+		return new self($props_n_values, TRUE, $timezone);
78 78
 	}
79 79
 
80 80
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @access        public
86 86
 	 * @param string $fname
87 87
 	 */
88
-	public function set_fname( $fname = '' ) {
89
-		$this->set( 'ATT_fname', $fname );
88
+	public function set_fname($fname = '') {
89
+		$this->set('ATT_fname', $fname);
90 90
 	}
91 91
 
92 92
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @access        public
98 98
 	 * @param string $lname
99 99
 	 */
100
-	public function set_lname( $lname = '' ) {
101
-		$this->set( 'ATT_lname', $lname );
100
+	public function set_lname($lname = '') {
101
+		$this->set('ATT_lname', $lname);
102 102
 	}
103 103
 
104 104
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * @access        public
110 110
 	 * @param string $address
111 111
 	 */
112
-	public function set_address( $address = '' ) {
113
-		$this->set( 'ATT_address', $address );
112
+	public function set_address($address = '') {
113
+		$this->set('ATT_address', $address);
114 114
 	}
115 115
 
116 116
 
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 * @access        public
122 122
 	 * @param        string $address2
123 123
 	 */
124
-	public function set_address2( $address2 = '' ) {
125
-		$this->set( 'ATT_address2', $address2 );
124
+	public function set_address2($address2 = '') {
125
+		$this->set('ATT_address2', $address2);
126 126
 	}
127 127
 
128 128
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @access        public
134 134
 	 * @param        string $city
135 135
 	 */
136
-	public function set_city( $city = '' ) {
137
-		$this->set( 'ATT_city', $city );
136
+	public function set_city($city = '') {
137
+		$this->set('ATT_city', $city);
138 138
 	}
139 139
 
140 140
 
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
 	 * @access        public
146 146
 	 * @param        int $STA_ID
147 147
 	 */
148
-	public function set_state( $STA_ID = 0 ) {
149
-		$this->set( 'STA_ID', $STA_ID );
148
+	public function set_state($STA_ID = 0) {
149
+		$this->set('STA_ID', $STA_ID);
150 150
 	}
151 151
 
152 152
 
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 	 * @access        public
158 158
 	 * @param        string $CNT_ISO
159 159
 	 */
160
-	public function set_country( $CNT_ISO = '' ) {
161
-		$this->set( 'CNT_ISO', $CNT_ISO );
160
+	public function set_country($CNT_ISO = '') {
161
+		$this->set('CNT_ISO', $CNT_ISO);
162 162
 	}
163 163
 
164 164
 
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 	 * @access        public
170 170
 	 * @param        string $zip
171 171
 	 */
172
-	public function set_zip( $zip = '' ) {
173
-		$this->set( 'ATT_zip', $zip );
172
+	public function set_zip($zip = '') {
173
+		$this->set('ATT_zip', $zip);
174 174
 	}
175 175
 
176 176
 
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	 * @access        public
182 182
 	 * @param        string $email
183 183
 	 */
184
-	public function set_email( $email = '' ) {
185
-		$this->set( 'ATT_email', $email );
184
+	public function set_email($email = '') {
185
+		$this->set('ATT_email', $email);
186 186
 	}
187 187
 
188 188
 
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	 * @access        public
194 194
 	 * @param        string $phone
195 195
 	 */
196
-	public function set_phone( $phone = '' ) {
197
-		$this->set( 'ATT_phone', $phone );
196
+	public function set_phone($phone = '') {
197
+		$this->set('ATT_phone', $phone);
198 198
 	}
199 199
 
200 200
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 	 * @access        public
206 206
 	 * @param        bool $ATT_deleted
207 207
 	 */
208
-	public function set_deleted( $ATT_deleted = FALSE ) {
209
-		$this->set( 'ATT_deleted', $ATT_deleted );
208
+	public function set_deleted($ATT_deleted = FALSE) {
209
+		$this->set('ATT_deleted', $ATT_deleted);
210 210
 	}
211 211
 
212 212
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @return int
220 220
 	 */
221 221
 	public function wp_user() {
222
-		return $this->get( 'ATT_author' );
222
+		return $this->get('ATT_author');
223 223
 	}
224 224
 
225 225
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 * @return string
231 231
 	 */
232 232
 	public function fname() {
233
-		return $this->get( 'ATT_fname' );
233
+		return $this->get('ATT_fname');
234 234
 	}
235 235
 
236 236
 
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	 * @param bool $apply_html_entities
251 251
 	 * @return string
252 252
 	 */
253
-	public function full_name( $apply_html_entities = FALSE ) {
254
-		$full_name = $this->fname() . ' ' . $this->lname();
255
-		return $apply_html_entities ? htmlentities( $full_name, ENT_QUOTES, 'UTF-8' ) : $full_name;
253
+	public function full_name($apply_html_entities = FALSE) {
254
+		$full_name = $this->fname().' '.$this->lname();
255
+		return $apply_html_entities ? htmlentities($full_name, ENT_QUOTES, 'UTF-8') : $full_name;
256 256
 	}
257 257
 
258 258
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	 * @return string
264 264
 	 */
265 265
 	public function lname() {
266
-		return $this->get( 'ATT_lname' );
266
+		return $this->get('ATT_lname');
267 267
 	}
268 268
 
269 269
 
@@ -277,26 +277,26 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	public function full_address_as_array() {
279 279
 		$full_address_array = array();
280
-		$initial_address_fields = array( 'ATT_address', 'ATT_address2', 'ATT_city', );
281
-		foreach ( $initial_address_fields as $address_field_name ) {
282
-			$address_fields_value = $this->get( $address_field_name );
283
-			if ( !empty( $address_fields_value ) ) {
284
-				$full_address_array[ ] = $address_fields_value;
280
+		$initial_address_fields = array('ATT_address', 'ATT_address2', 'ATT_city',);
281
+		foreach ($initial_address_fields as $address_field_name) {
282
+			$address_fields_value = $this->get($address_field_name);
283
+			if ( ! empty($address_fields_value)) {
284
+				$full_address_array[] = $address_fields_value;
285 285
 			}
286 286
 		}
287 287
 		//now handle state and country
288 288
 		$state_obj = $this->state_obj();
289
-		if ( !empty( $state_obj ) ) {
290
-			$full_address_array[ ] = $state_obj->name();
289
+		if ( ! empty($state_obj)) {
290
+			$full_address_array[] = $state_obj->name();
291 291
 		}
292 292
 		$country_obj = $this->country_obj();
293
-		if ( !empty( $country_obj ) ) {
294
-			$full_address_array[ ] = $country_obj->name();
293
+		if ( ! empty($country_obj)) {
294
+			$full_address_array[] = $country_obj->name();
295 295
 		}
296 296
 		//lastly get the xip
297 297
 		$zip_value = $this->zip();
298
-		if ( !empty( $zip_value ) ) {
299
-			$full_address_array[ ] = $zip_value;
298
+		if ( ! empty($zip_value)) {
299
+			$full_address_array[] = $zip_value;
300 300
 		}
301 301
 		return $full_address_array;
302 302
 	}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	 * @return string
309 309
 	 */
310 310
 	public function address() {
311
-		return $this->get( 'ATT_address' );
311
+		return $this->get('ATT_address');
312 312
 	}
313 313
 
314 314
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 * @return string
319 319
 	 */
320 320
 	public function address2() {
321
-		return $this->get( 'ATT_address2' );
321
+		return $this->get('ATT_address2');
322 322
 	}
323 323
 
324 324
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 * @return string
329 329
 	 */
330 330
 	public function city() {
331
-		return $this->get( 'ATT_city' );
331
+		return $this->get('ATT_city');
332 332
 	}
333 333
 
334 334
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 * @return string
339 339
 	 */
340 340
 	public function state_ID() {
341
-		return $this->get( 'STA_ID' );
341
+		return $this->get('STA_ID');
342 342
 	}
343 343
 
344 344
 
@@ -357,17 +357,17 @@  discard block
 block discarded – undo
357 357
 	 * @return EE_State
358 358
 	 */
359 359
 	public function state_obj() {
360
-		return $this->get_first_related( 'State' );
360
+		return $this->get_first_related('State');
361 361
 	}
362 362
 
363 363
 	/**
364 364
 	 * Returns the state's name, otherwise 'Unknown'
365 365
 	 * @return string
366 366
 	 */
367
-	public function state_name(){
368
-		if( $this->state_obj() ){
367
+	public function state_name() {
368
+		if ($this->state_obj()) {
369 369
 			return $this->state_obj()->name();
370
-		}else{
370
+		} else {
371 371
 			return '';
372 372
 		}
373 373
 	}
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	 * @return string
382 382
 	 */
383 383
 	public function state() {
384
-		if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) {
384
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
385 385
 			return $this->state_abbrev();
386 386
 		} else {
387 387
 			return $this->state_name();
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 * @return string
396 396
 	 */
397 397
 	public function country_ID() {
398
-		return $this->get( 'CNT_ISO' );
398
+		return $this->get('CNT_ISO');
399 399
 	}
400 400
 
401 401
 
@@ -405,17 +405,17 @@  discard block
 block discarded – undo
405 405
 	 * @return EE_Country
406 406
 	 */
407 407
 	public function country_obj() {
408
-		return $this->get_first_related( 'Country' );
408
+		return $this->get_first_related('Country');
409 409
 	}
410 410
 
411 411
 	/**
412 412
 	 * Returns the country's name if known, otherwise 'Unknown'
413 413
 	 * @return string
414 414
 	 */
415
-	public function country_name(){
416
-		if( $this->country_obj() ){
415
+	public function country_name() {
416
+		if ($this->country_obj()) {
417 417
 			return $this->country_obj()->name();
418
-		}else{
418
+		} else {
419 419
 			return '';
420 420
 		}
421 421
 	}
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	 * @return string
430 430
 	 */
431 431
 	public function country() {
432
-		if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) {
432
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
433 433
 			return $this->country_ID();
434 434
 		} else {
435 435
 			return $this->country_name();
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 * @return string
444 444
 	 */
445 445
 	public function zip() {
446
-		return $this->get( 'ATT_zip' );
446
+		return $this->get('ATT_zip');
447 447
 	}
448 448
 
449 449
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	 * @return string
454 454
 	 */
455 455
 	public function email() {
456
-		return $this->get( 'ATT_email' );
456
+		return $this->get('ATT_email');
457 457
 	}
458 458
 
459 459
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 * @return string
464 464
 	 */
465 465
 	public function phone() {
466
-		return $this->get( 'ATT_phone' );
466
+		return $this->get('ATT_phone');
467 467
 	}
468 468
 
469 469
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	 * @return        bool
474 474
 	 */
475 475
 	public function deleted() {
476
-		return $this->get( 'ATT_deleted' );
476
+		return $this->get('ATT_deleted');
477 477
 	}
478 478
 
479 479
 
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 	 * @param array $query_params
484 484
 	 * @return EE_Registration[]
485 485
 	 */
486
-	public function get_registrations( $query_params = array() ) {
487
-		return $this->get_many_related( 'Registration', $query_params );
486
+	public function get_registrations($query_params = array()) {
487
+		return $this->get_many_related('Registration', $query_params);
488 488
 	}
489 489
 
490 490
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	 * @return EE_Registration
495 495
 	 */
496 496
 	public function get_most_recent_registration() {
497
-		return $this->get_first_related( 'Registration', array( 'order_by' => array( 'REG_date' => 'DESC' ) ) ); //null, 'REG_date', 'DESC', '=', 'OBJECT_K');
497
+		return $this->get_first_related('Registration', array('order_by' => array('REG_date' => 'DESC'))); //null, 'REG_date', 'DESC', '=', 'OBJECT_K');
498 498
 	}
499 499
 
500 500
 
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 	 * @param int $event_id
505 505
 	 * @return EE_Registration
506 506
 	 */
507
-	public function get_most_recent_registration_for_event( $event_id ) {
508
-		return $this->get_first_related( 'Registration', array(array( 'EVT_ID' => $event_id ), 'order_by' => array('REG_date' => 'DESC')));//, '=', 'OBJECT_K' );
507
+	public function get_most_recent_registration_for_event($event_id) {
508
+		return $this->get_first_related('Registration', array(array('EVT_ID' => $event_id), 'order_by' => array('REG_date' => 'DESC'))); //, '=', 'OBJECT_K' );
509 509
 	}
510 510
 
511 511
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	 * @return array
516 516
 	 */
517 517
 	public function events() {
518
-		return $this->get_many_related( 'Event' );
518
+		return $this->get_many_related('Event');
519 519
 	}
520 520
 
521 521
 	/**
@@ -524,17 +524,17 @@  discard block
 block discarded – undo
524 524
 	 * @param EE_Payment_Method $payment_method the _gateway_name property on the gateway class
525 525
 	 * @return EE_Form_Section_Proper
526 526
 	 */
527
-	public function billing_info_for_payment_method($payment_method){
527
+	public function billing_info_for_payment_method($payment_method) {
528 528
 		$pm_type = $payment_method->type_obj();
529
-		if( ! $pm_type instanceof EE_PMT_Base ){
529
+		if ( ! $pm_type instanceof EE_PMT_Base) {
530 530
 			return NULL;
531 531
 		}
532
-		$billing_info =  $this->get_post_meta( $this->get_billing_info_postmeta_name( $payment_method ), true );
533
-		if ( ! $billing_info){
532
+		$billing_info = $this->get_post_meta($this->get_billing_info_postmeta_name($payment_method), true);
533
+		if ( ! $billing_info) {
534 534
 			return NULL;
535 535
 		}
536 536
 		$billing_form = $pm_type->billing_form();
537
-		$billing_form->receive_form_submission( array( $billing_form->name() => $billing_info ), FALSE );
537
+		$billing_form->receive_form_submission(array($billing_form->name() => $billing_info), FALSE);
538 538
 		return $billing_form;
539 539
 	}
540 540
 
@@ -544,10 +544,10 @@  discard block
 block discarded – undo
544 544
 	 * @param EE_Payment_Method $payment_method
545 545
 	 * @return string
546 546
 	 */
547
-	public function get_billing_info_postmeta_name($payment_method){
548
-		if( $payment_method->type_obj() instanceof EE_PMT_Base ){
549
-			return 'billing_info_' . $payment_method->type_obj()->system_name();
550
-		}else{
547
+	public function get_billing_info_postmeta_name($payment_method) {
548
+		if ($payment_method->type_obj() instanceof EE_PMT_Base) {
549
+			return 'billing_info_'.$payment_method->type_obj()->system_name();
550
+		} else {
551 551
 			return NULL;
552 552
 		}
553 553
 	}
@@ -558,13 +558,13 @@  discard block
 block discarded – undo
558 558
 	 * @param EE_Payment_Method $payment_method
559 559
 	 * @return boolean
560 560
 	 */
561
-	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method){
562
-		if( ! $billing_form instanceof EE_Billing_Attendee_Info_Form ){
563
-			EE_Error::add_error( __( 'Cannot save billing info because there is none.', 'event_espresso' ) );
561
+	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method) {
562
+		if ( ! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
563
+			EE_Error::add_error(__('Cannot save billing info because there is none.', 'event_espresso'));
564 564
 			return false;
565 565
 		}
566 566
 		$billing_form->clean_sensitive_data();
567
-		return update_post_meta($this->ID(), $this->get_billing_info_postmeta_name( $payment_method ), $billing_form->input_values( true ) );
567
+		return update_post_meta($this->ID(), $this->get_billing_info_postmeta_name($payment_method), $billing_form->input_values(true));
568 568
 	}
569 569
 
570 570
 	/**
@@ -580,14 +580,14 @@  discard block
 block discarded – undo
580 580
 	 * @return string
581 581
 	 */
582 582
 	public function get_admin_edit_link() {
583
-		EE_Registry::instance()->load_helper( 'URL' );
583
+		EE_Registry::instance()->load_helper('URL');
584 584
 		return EEH_URL::add_query_args_and_nonce(
585 585
 			array(
586 586
 				'page' => 'espresso_registrations',
587 587
 				'action' => 'edit_attendee',
588 588
 				'post' => $this->ID()
589 589
 			),
590
-			admin_url( 'admin.php' )
590
+			admin_url('admin.php')
591 591
 		);
592 592
 	}
593 593
 
@@ -604,13 +604,13 @@  discard block
 block discarded – undo
604 604
 	 * @return string
605 605
 	 */
606 606
 	public function get_admin_overview_link() {
607
-		EE_Registry::instance()->load_helper( 'URL' );
607
+		EE_Registry::instance()->load_helper('URL');
608 608
 		return EEH_URL::add_query_args_and_nonce(
609 609
 			array(
610 610
 				'page' => 'espresso_registrations',
611 611
 				'action' => 'contact_list'
612 612
 			),
613
-			admin_url( 'admin.php' )
613
+			admin_url('admin.php')
614 614
 		);
615 615
 	}
616 616
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 	public function state_name(){
368 368
 		if( $this->state_obj() ){
369 369
 			return $this->state_obj()->name();
370
-		}else{
370
+		} else{
371 371
 			return '';
372 372
 		}
373 373
 	}
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	public function country_name(){
416 416
 		if( $this->country_obj() ){
417 417
 			return $this->country_obj()->name();
418
-		}else{
418
+		} else{
419 419
 			return '';
420 420
 		}
421 421
 	}
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 	public function get_billing_info_postmeta_name($payment_method){
548 548
 		if( $payment_method->type_obj() instanceof EE_PMT_Base ){
549 549
 			return 'billing_info_' . $payment_method->type_obj()->system_name();
550
-		}else{
550
+		} else{
551 551
 			return NULL;
552 552
 		}
553 553
 	}
Please login to merge, or discard this patch.
core/db_models/EEM_Ticket.model.php 2 patches
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
25
-require_once ( EE_CLASSES . 'EE_Ticket.class.php' );
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once (EE_CLASSES.'EE_Ticket.class.php');
26 26
 
27 27
 class EEM_Ticket extends EEM_Soft_Delete_Base {
28 28
 
@@ -35,35 +35,35 @@  discard block
 block discarded – undo
35 35
 	 *		@access private
36 36
 	 *		@param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
37 37
 	 */
38
-	protected function __construct( $timezone ) {
39
-		$this->singular_item = __('Ticket','event_espresso');
40
-		$this->plural_item = __('Tickets','event_espresso');
38
+	protected function __construct($timezone) {
39
+		$this->singular_item = __('Ticket', 'event_espresso');
40
+		$this->plural_item = __('Tickets', 'event_espresso');
41 41
 
42 42
 		$this->_tables = array(
43 43
 			'Ticket'=> new EE_Primary_Table('esp_ticket', 'TKT_ID')
44 44
 		);
45 45
 		$this->_fields = array(
46 46
 			'Ticket'=>array(
47
-				'TKT_ID'=> new EE_Primary_Key_Int_Field('TKT_ID', __('Ticket ID','event_espresso')),
48
-				'TTM_ID'=>new EE_Foreign_Key_Int_Field('TTM_ID', __('Ticket Template ID','event_espresso'), false, 0, 'Ticket_Template'),
47
+				'TKT_ID'=> new EE_Primary_Key_Int_Field('TKT_ID', __('Ticket ID', 'event_espresso')),
48
+				'TTM_ID'=>new EE_Foreign_Key_Int_Field('TTM_ID', __('Ticket Template ID', 'event_espresso'), false, 0, 'Ticket_Template'),
49 49
 				'TKT_name'=>new EE_Plain_Text_Field('TKT_name', __('Ticket Name', 'event_espresso'), false, ''),
50
-				'TKT_description'=>new EE_Post_Content_Field('TKT_description', __('Description of Ticket', 'event_espresso'), false, '' ),
51
-				'TKT_start_date'=>new EE_Datetime_Field('TKT_start_date', __('Start time/date of Ticket','event_espresso'), false, time(), $timezone ),
52
-				'TKT_end_date'=>new EE_Datetime_Field('TKT_end_date', __('End time/date of Ticket','event_espresso'), false, time(), $timezone ),
53
-				'TKT_min'=>new EE_Integer_Field('TKT_min', __('Minimum quantity of this ticket that must be purchased', 'event_espresso'), false, 0 ),
54
-				'TKT_max'=>new EE_Infinite_Integer_Field('TKT_max', __('Maximum quantity of this ticket that can be purchased in one transaction', 'event_espresso'), false, EE_INF ),
50
+				'TKT_description'=>new EE_Post_Content_Field('TKT_description', __('Description of Ticket', 'event_espresso'), false, ''),
51
+				'TKT_start_date'=>new EE_Datetime_Field('TKT_start_date', __('Start time/date of Ticket', 'event_espresso'), false, time(), $timezone),
52
+				'TKT_end_date'=>new EE_Datetime_Field('TKT_end_date', __('End time/date of Ticket', 'event_espresso'), false, time(), $timezone),
53
+				'TKT_min'=>new EE_Integer_Field('TKT_min', __('Minimum quantity of this ticket that must be purchased', 'event_espresso'), false, 0),
54
+				'TKT_max'=>new EE_Infinite_Integer_Field('TKT_max', __('Maximum quantity of this ticket that can be purchased in one transaction', 'event_espresso'), false, EE_INF),
55 55
 				'TKT_price'=> new EE_Money_Field('TKT_price', 'Final calculated price for ticket', false, 0),
56 56
 				'TKT_sold' => new EE_Integer_Field('TKT_sold', __('Number of this ticket sold', 'event_espresso'), false, 0),
57
-				'TKT_qty'=>new EE_Infinite_Integer_Field('TKT_qty', __('Quantity of this ticket that is available','event_espresso'), false, EE_INF),
58
-				'TKT_uses'=>new EE_Infinite_Integer_Field('TKT_uses', __('Number of datetimes this ticket can be used at', 'event_espresso'), false, EE_INF ),
59
-				'TKT_required'=>new EE_Boolean_Field('TKT_required', __("Flag indicating whether this ticket must be purchased with a transaction", "event_espresso"), false, false ),
60
-				'TKT_taxable'=>new EE_Boolean_Field('TKT_taxable', __("Flag indicating whether there is tax applied on this ticket", "event_espresso"), false,false),
61
-				'TKT_is_default'=>new EE_Boolean_Field('TKT_is_default', __('Flag indicating that this ticket is a default ticket', 'event_espresso'), false, false ),
57
+				'TKT_qty'=>new EE_Infinite_Integer_Field('TKT_qty', __('Quantity of this ticket that is available', 'event_espresso'), false, EE_INF),
58
+				'TKT_uses'=>new EE_Infinite_Integer_Field('TKT_uses', __('Number of datetimes this ticket can be used at', 'event_espresso'), false, EE_INF),
59
+				'TKT_required'=>new EE_Boolean_Field('TKT_required', __("Flag indicating whether this ticket must be purchased with a transaction", "event_espresso"), false, false),
60
+				'TKT_taxable'=>new EE_Boolean_Field('TKT_taxable', __("Flag indicating whether there is tax applied on this ticket", "event_espresso"), false, false),
61
+				'TKT_is_default'=>new EE_Boolean_Field('TKT_is_default', __('Flag indicating that this ticket is a default ticket', 'event_espresso'), false, false),
62 62
 				'TKT_order' => new EE_Integer_Field('TKT_order', __('The order in which the Ticket is displayed in the editor (used for autosaves when the form doesn\'t have the ticket ID yet)', 'event_espresso'), false, 0),
63
-				'TKT_row' => new EE_Integer_Field('TKT_row', __('How tickets are displayed in the ui', 'event_espresso'), false, 0 ),
63
+				'TKT_row' => new EE_Integer_Field('TKT_row', __('How tickets are displayed in the ui', 'event_espresso'), false, 0),
64 64
 				'TKT_deleted' => new EE_Trashed_Flag_Field('TKT_deleted', __('Flag indicating if this has been archived or not', 'event_espresso'), false, false),
65
-				'TKT_wp_user' => new EE_WP_User_Field('TKT_wp_user', __('Ticket Creator ID', 'event_espresso'), FALSE ),
66
-				'TKT_parent' => new EE_Integer_Field('TKT_parent', __('Indicates what TKT_ID is the parent of this TKT_ID (used in autosaves/revisions)'), true, 0 )
65
+				'TKT_wp_user' => new EE_WP_User_Field('TKT_wp_user', __('Ticket Creator ID', 'event_espresso'), FALSE),
66
+				'TKT_parent' => new EE_Integer_Field('TKT_parent', __('Indicates what TKT_ID is the parent of this TKT_ID (used in autosaves/revisions)'), true, 0)
67 67
 			));
68 68
 		$this->_model_relations = array(
69 69
 			'Datetime'=>new EE_HABTM_Relation('Datetime_Ticket'),
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 		);
76 76
 
77 77
 		//this model is generally available for reading
78
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Default_Public('TKT_is_default', 'Datetime.Event');
78
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Default_Public('TKT_is_default', 'Datetime.Event');
79 79
 		//account for default tickets in the caps
80
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Default_Protected( 'TKT_is_default', 'Datetime.Event' );
81
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Default_Protected( 'TKT_is_default', 'Datetime.Event' );
82
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Default_Protected( 'TKT_is_default', 'Datetime.Event' );
83
-		parent::__construct( $timezone );
80
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Default_Protected('TKT_is_default', 'Datetime.Event');
81
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Default_Protected('TKT_is_default', 'Datetime.Event');
82
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Default_Protected('TKT_is_default', 'Datetime.Event');
83
+		parent::__construct($timezone);
84 84
 	}
85 85
 
86 86
 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function get_all_default_tickets() {
93 93
 		/** @type EE_Ticket[] $tickets */
94
-		$tickets = $this->get_all( array( array('TKT_is_default' => 1), 'order_by' => array('TKT_ID' => 'ASC')) );
94
+		$tickets = $this->get_all(array(array('TKT_is_default' => 1), 'order_by' => array('TKT_ID' => 'ASC')));
95 95
 		//we need to set the start date and end date to today's date and the start of the default dtt
96
-		return $this->_set_default_dates( $tickets );
96
+		return $this->_set_default_dates($tickets);
97 97
 	}
98 98
 
99 99
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 	 * @param EE_Ticket[] $tickets
104 104
 	 * @return EE_Ticket[]
105 105
 	 */
106
-	private function _set_default_dates( $tickets ) {
107
-		foreach ( $tickets as $ticket ) {
108
-			$ticket->set('TKT_start_date', $this->current_time_for_query('TKT_start_date', true) );
109
-			$ticket->set('TKT_end_date', $this->current_time_for_query( 'TKT_end_date', true ) + (60 * 60 * 24 * 30 ) );
110
-			$ticket->set_end_time( $this->convert_datetime_for_query( 'TKT_end_date', '11:59 pm', 'g:i a', $this->_timezone ) );
106
+	private function _set_default_dates($tickets) {
107
+		foreach ($tickets as $ticket) {
108
+			$ticket->set('TKT_start_date', $this->current_time_for_query('TKT_start_date', true));
109
+			$ticket->set('TKT_end_date', $this->current_time_for_query('TKT_end_date', true) + (60 * 60 * 24 * 30));
110
+			$ticket->set_end_time($this->convert_datetime_for_query('TKT_end_date', '11:59 pm', 'g:i a', $this->_timezone));
111 111
 		}
112 112
 
113 113
 		return $tickets;
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	 * @param array $query_params
123 123
 	 * @return int
124 124
 	 */
125
-	public function sum_tickets_currently_available_at_datetime($DTT_ID, $query_params = array()){
126
-		return EEM_Datetime::instance()->sum_tickets_currently_available_at_datetime( $DTT_ID, $query_params );
125
+	public function sum_tickets_currently_available_at_datetime($DTT_ID, $query_params = array()) {
126
+		return EEM_Datetime::instance()->sum_tickets_currently_available_at_datetime($DTT_ID, $query_params);
127 127
 	}
128 128
 
129 129
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @param EE_Ticket[] $tickets
134 134
 	 * @return void
135 135
 	 */
136
-	public function update_tickets_sold($tickets){
137
-		foreach($tickets as $ticket){
136
+	public function update_tickets_sold($tickets) {
137
+		foreach ($tickets as $ticket) {
138 138
 			/* @var  $ticket EE_Ticket */
139 139
 			$ticket->update_tickets_sold();
140 140
 		}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
core/db_models/EEM_Question.model.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2 2
 	exit('No direct script access allowed');
3 3
 }
4
-require_once( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
5
-require_once( EE_CLASSES . 'EE_Question.class.php' );
4
+require_once(EE_MODELS.'EEM_Soft_Delete_Base.model.php');
5
+require_once(EE_CLASSES.'EE_Question.class.php');
6 6
 
7 7
 
8 8
 
@@ -101,52 +101,52 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @param null $timezone
103 103
 	 */
104
-	protected function __construct( $timezone = NULL ) {
105
-		$this->singular_item = __('Question','event_espresso');
106
-		$this->plural_item = __('Questions','event_espresso');
107
-		$this->_allowed_question_types=apply_filters(
104
+	protected function __construct($timezone = NULL) {
105
+		$this->singular_item = __('Question', 'event_espresso');
106
+		$this->plural_item = __('Questions', 'event_espresso');
107
+		$this->_allowed_question_types = apply_filters(
108 108
 			'FHEE__EEM_Question__construct__allowed_question_types',
109 109
 			array(
110
-				EEM_Question::QST_type_text =>__('Text','event_espresso'),
111
-				EEM_Question::QST_type_textarea =>__('Textarea','event_espresso'),
112
-				EEM_Question::QST_type_checkbox =>__('Checkboxes','event_espresso'),
113
-				EEM_Question::QST_type_radio =>__('Radio Buttons','event_espresso'),
114
-				EEM_Question::QST_type_dropdown =>__('Dropdown','event_espresso'),
115
-				EEM_Question::QST_type_state =>__('State/Province Dropdown','event_espresso'),
116
-				EEM_Question::QST_type_country =>__('Country Dropdown','event_espresso'),
117
-				EEM_Question::QST_type_date =>__('Date Picker','event_espresso'),
118
-				EEM_Question::QST_type_html_textarea => __( 'HTML Textarea', 'event_espresso' ),
119
-				EEM_Question::QST_type_email => __( 'Email', 'event_espresso' ),
120
-				EEM_Question::QST_type_us_phone => __( 'USA - Format Phone', 'event_espresso' ),
121
-				EEM_Question::QST_type_decimal => __( 'Number', 'event_espresso' ),
122
-				EEM_Question::QST_type_int => __( 'Whole Number', 'event_espresso' ),
123
-				EEM_Question::QST_type_url => __( 'URL', 'event_espresso' ),
124
-				EEM_Question::QST_type_year => __( 'Year', 'event_espresso' ),
125
-				EEM_Question::QST_type_multi_select => __( 'Multi Select', 'event_espresso' )
110
+				EEM_Question::QST_type_text =>__('Text', 'event_espresso'),
111
+				EEM_Question::QST_type_textarea =>__('Textarea', 'event_espresso'),
112
+				EEM_Question::QST_type_checkbox =>__('Checkboxes', 'event_espresso'),
113
+				EEM_Question::QST_type_radio =>__('Radio Buttons', 'event_espresso'),
114
+				EEM_Question::QST_type_dropdown =>__('Dropdown', 'event_espresso'),
115
+				EEM_Question::QST_type_state =>__('State/Province Dropdown', 'event_espresso'),
116
+				EEM_Question::QST_type_country =>__('Country Dropdown', 'event_espresso'),
117
+				EEM_Question::QST_type_date =>__('Date Picker', 'event_espresso'),
118
+				EEM_Question::QST_type_html_textarea => __('HTML Textarea', 'event_espresso'),
119
+				EEM_Question::QST_type_email => __('Email', 'event_espresso'),
120
+				EEM_Question::QST_type_us_phone => __('USA - Format Phone', 'event_espresso'),
121
+				EEM_Question::QST_type_decimal => __('Number', 'event_espresso'),
122
+				EEM_Question::QST_type_int => __('Whole Number', 'event_espresso'),
123
+				EEM_Question::QST_type_url => __('URL', 'event_espresso'),
124
+				EEM_Question::QST_type_year => __('Year', 'event_espresso'),
125
+				EEM_Question::QST_type_multi_select => __('Multi Select', 'event_espresso')
126 126
 			)
127 127
 		);
128 128
 		$this->_question_descriptions = apply_filters(
129 129
 			'FHEE__EEM_Question__construct__allowed_question_types',
130 130
 			array(
131
-				EEM_Question::QST_type_text          => __( 'A single line text input field', 'event_espresso' ),
132
-				EEM_Question::QST_type_textarea      => __( 'A multi line text input field', 'event_espresso' ),
133
-				EEM_Question::QST_type_checkbox      => __( 'Allows multiple preset options to be selected', 'event_espresso' ),
134
-				EEM_Question::QST_type_radio         => __( 'Allows a single preset option to be selected', 'event_espresso' ),
135
-				EEM_Question::QST_type_dropdown      => __( 'A dropdown that allows a single selection', 'event_espresso' ),
136
-				EEM_Question::QST_type_state         => __( 'A dropdown that lists states/provinces', 'event_espresso' ),
137
-				EEM_Question::QST_type_country       => __( 'A dropdown that lists countries', 'event_espresso' ),
138
-				EEM_Question::QST_type_date          => __( 'A popup calendar that allows date selections', 'event_espresso' ),
139
-				EEM_Question::QST_type_html_textarea => __( 'A multi line text input field that allows HTML', 'event_espresso' ),
140
-				EEM_Question::QST_type_email         => __( 'A text field that must contain a valid Email address', 'event_espresso' ),
141
-				EEM_Question::QST_type_us_phone      => __( 'A text field that must contain a valid US phone number', 'event_espresso' ),
142
-				EEM_Question::QST_type_decimal       => __( 'A text field that allows number values with decimals', 'event_espresso' ),
143
-				EEM_Question::QST_type_int           => __( 'A text field that only allows whole numbers (no decimals)', 'event_espresso' ),
144
-				EEM_Question::QST_type_url           => __( 'A text field that must contain a valid URL', 'event_espresso' ),
145
-				EEM_Question::QST_type_year          => __( 'A dropdown that lists the last 100 years', 'event_espresso' ),
146
-				EEM_Question::QST_type_multi_select  => __( 'A dropdown that allows multiple selections', 'event_espresso' )
131
+				EEM_Question::QST_type_text          => __('A single line text input field', 'event_espresso'),
132
+				EEM_Question::QST_type_textarea      => __('A multi line text input field', 'event_espresso'),
133
+				EEM_Question::QST_type_checkbox      => __('Allows multiple preset options to be selected', 'event_espresso'),
134
+				EEM_Question::QST_type_radio         => __('Allows a single preset option to be selected', 'event_espresso'),
135
+				EEM_Question::QST_type_dropdown      => __('A dropdown that allows a single selection', 'event_espresso'),
136
+				EEM_Question::QST_type_state         => __('A dropdown that lists states/provinces', 'event_espresso'),
137
+				EEM_Question::QST_type_country       => __('A dropdown that lists countries', 'event_espresso'),
138
+				EEM_Question::QST_type_date          => __('A popup calendar that allows date selections', 'event_espresso'),
139
+				EEM_Question::QST_type_html_textarea => __('A multi line text input field that allows HTML', 'event_espresso'),
140
+				EEM_Question::QST_type_email         => __('A text field that must contain a valid Email address', 'event_espresso'),
141
+				EEM_Question::QST_type_us_phone      => __('A text field that must contain a valid US phone number', 'event_espresso'),
142
+				EEM_Question::QST_type_decimal       => __('A text field that allows number values with decimals', 'event_espresso'),
143
+				EEM_Question::QST_type_int           => __('A text field that only allows whole numbers (no decimals)', 'event_espresso'),
144
+				EEM_Question::QST_type_url           => __('A text field that must contain a valid URL', 'event_espresso'),
145
+				EEM_Question::QST_type_year          => __('A dropdown that lists the last 100 years', 'event_espresso'),
146
+				EEM_Question::QST_type_multi_select  => __('A dropdown that allows multiple selections', 'event_espresso')
147 147
 			)
148 148
 		);
149
-		$this->_question_type_categories = (array)apply_filters(
149
+		$this->_question_type_categories = (array) apply_filters(
150 150
 				'FHEE__EEM_Question__construct__question_type_categories',
151 151
 				array(
152 152
 				'text' => array(
@@ -171,22 +171,22 @@  discard block
 block discarded – undo
171 171
 		);
172 172
 
173 173
 		$this->_tables = array(
174
-			'Question'=>new EE_Primary_Table('esp_question','QST_ID')
174
+			'Question'=>new EE_Primary_Table('esp_question', 'QST_ID')
175 175
 		);
176 176
 		$this->_fields = array(
177 177
 			'Question'=>array(
178
-				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID','event_espresso')),
179
-				'QST_display_text'=>new EE_Post_Content_Field('QST_display_text', __('Question Text','event_espresso'), true, ''),
180
-				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)','event_espresso'), true, ''),
181
-				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question','event_espresso'), false, '' ),
182
-				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type','event_espresso'),false, 'TEXT',$this->_allowed_question_types),
183
-				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?','event_espresso'), false, false),
184
-				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided','event_espresso'), true, ''),
185
-				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order','event_espresso'), false, 0),
186
-				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?','event_espresso'), false, false),
187
-				'QST_max' => new EE_Infinite_Integer_Field( 'QST_max', __( 'Max Size', 'event_espresso'	), false, EE_INF ),
188
-				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID','event_espresso'), false ),
189
-				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted','event_espresso'), false, false)
178
+				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso')),
179
+				'QST_display_text'=>new EE_Post_Content_Field('QST_display_text', __('Question Text', 'event_espresso'), true, ''),
180
+				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)', 'event_espresso'), true, ''),
181
+				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question', 'event_espresso'), false, ''),
182
+				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type', 'event_espresso'), false, 'TEXT', $this->_allowed_question_types),
183
+				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?', 'event_espresso'), false, false),
184
+				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided', 'event_espresso'), true, ''),
185
+				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order', 'event_espresso'), false, 0),
186
+				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?', 'event_espresso'), false, false),
187
+				'QST_max' => new EE_Infinite_Integer_Field('QST_max', __('Max Size', 'event_espresso'), false, EE_INF),
188
+				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID', 'event_espresso'), false),
189
+				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted', 'event_espresso'), false, false)
190 190
 			)
191 191
 		);
192 192
 		$this->_model_relations = array(
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 			'Question_Group_Question'=>new EE_Has_Many_Relation()
199 199
 		);
200 200
 		//this model is generally available for reading
201
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
202
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QST_system');
203
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QST_system');
204
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QST_system');
205
-		parent::__construct( $timezone );
201
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
202
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QST_system');
203
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QST_system');
204
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QST_system');
205
+		parent::__construct($timezone);
206 206
 	}
207 207
 
208 208
 	/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 * but they can be extended
211 211
 	 * @return string[]
212 212
 	 */
213
-	public function allowed_question_types(){
213
+	public function allowed_question_types() {
214 214
 		return $this->_allowed_question_types;
215 215
 	}
216 216
 	/**
@@ -218,16 +218,16 @@  discard block
 block discarded – undo
218 218
 	 * @param string $question_type one of EEM_Question::allowed_question_types(
219 219
 	 * @return string[] like EEM_Question::allowed_question_types()
220 220
 	 */
221
-	public function question_types_in_same_category( $question_type ) {
222
-		$question_types = array( $question_type );
223
-		foreach( $this->_question_type_categories as $category => $question_types_in_category ) {
224
-			if( in_array( $question_type, $question_types_in_category ) ) {
221
+	public function question_types_in_same_category($question_type) {
222
+		$question_types = array($question_type);
223
+		foreach ($this->_question_type_categories as $category => $question_types_in_category) {
224
+			if (in_array($question_type, $question_types_in_category)) {
225 225
 				$question_types = $question_types_in_category;
226 226
 				break;
227 227
 			}
228 228
 		}
229 229
 
230
-		return array_intersect_key( $this->allowed_question_types(), array_flip( $question_types ) );
230
+		return array_intersect_key($this->allowed_question_types(), array_flip($question_types));
231 231
 	}
232 232
 
233 233
 	/**
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
 	 * @param string $category one of the top-level keys of EEM_Question::question_type_categories()
237 237
 	 * @return boolean
238 238
 	 */
239
-	public function question_type_is_in_category( $question_type, $category ) {
240
-		if( ! isset( $this->_question_type_categories[ $category ] ) ) {
239
+	public function question_type_is_in_category($question_type, $category) {
240
+		if ( ! isset($this->_question_type_categories[$category])) {
241 241
 			return false;
242 242
 		}
243
-		return in_array( $question_type, $this->_question_type_categories[ $category ] );
243
+		return in_array($question_type, $this->_question_type_categories[$category]);
244 244
 	}
245 245
 
246 246
 	/**
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 	 * @param string $system_question_group_id QSG_system
258 258
 	 * @return array of system question names (QST_system)
259 259
 	 */
260
-	public function allowed_system_questions_in_system_question_group( $system_question_group_id ) {
260
+	public function allowed_system_questions_in_system_question_group($system_question_group_id) {
261 261
 		$question_system_ids = array();
262
-		switch( $system_question_group_id ) {
262
+		switch ($system_question_group_id) {
263 263
 			case EEM_Question_Group::system_personal:
264 264
 				$question_system_ids = array(
265 265
 					EEM_Attendee::system_question_fname,
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 				);
281 281
 				break;
282 282
 		}
283
-		return apply_filters( 'FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id );
283
+		return apply_filters('FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id);
284 284
 	}
285 285
 
286 286
 	/**
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
 	 * @param string $system_question_group_id QSG_system
290 290
 	 * @return array of system question names (QST_system)
291 291
 	 */
292
-	public function required_system_questions_in_system_question_group( $system_question_group_id ) {
292
+	public function required_system_questions_in_system_question_group($system_question_group_id) {
293 293
 		$question_system_ids = null;
294
-		switch( $system_question_group_id ) {
294
+		switch ($system_question_group_id) {
295 295
 			case EEM_Question_Group::system_personal:
296
-				$question_system_ids =  array(
296
+				$question_system_ids = array(
297 297
 					EEM_Attendee::system_question_fname,
298 298
 					EEM_Attendee::system_question_email,
299 299
 				);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			default:
302 302
 				$question_system_ids = array();
303 303
 		}
304
-		return apply_filters( 'FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id );
304
+		return apply_filters('FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id);
305 305
 	}
306 306
 
307 307
 
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
 	 * @param $QST_system
313 313
 	 * @return int of QST_ID for the question that corresponds to that QST_system
314 314
 	 */
315
-	public function get_Question_ID_from_system_string( $QST_system ){
316
-		 return $this->get_var( array( array( 'QST_system' => $QST_system ) ) );
315
+	public function get_Question_ID_from_system_string($QST_system) {
316
+		 return $this->get_var(array(array('QST_system' => $QST_system)));
317 317
 	}
318 318
 
319 319
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 	 */
326 326
 	public function get_latest_question_order() {
327 327
 		$columns_to_select = array(
328
-			'max_order' => array("MAX(QST_order)","%d")
328
+			'max_order' => array("MAX(QST_order)", "%d")
329 329
 		);
330
-		$max = $this->_get_all_wpdb_results( array(), ARRAY_A, $columns_to_select );
331
-		return isset( $max[0], $max[0]['max_order'] ) ? $max[0]['max_order'] : 0;
330
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
331
+		return isset($max[0], $max[0]['max_order']) ? $max[0]['max_order'] : 0;
332 332
 	}
333 333
 
334 334
 	/**
@@ -357,10 +357,10 @@  discard block
 block discarded – undo
357 357
 	 * @param string $system_question_value
358 358
 	 * @return int|float
359 359
 	 */
360
-	public function absolute_max_for_system_question( $system_question_value ) {
360
+	public function absolute_max_for_system_question($system_question_value) {
361 361
 		$maxes = $this->system_question_maxes();
362
-		if( isset( $maxes[ $system_question_value ] ) ) {
363
-			return $maxes[ $system_question_value ];
362
+		if (isset($maxes[$system_question_value])) {
363
+			return $maxes[$system_question_value];
364 364
 		} else {
365 365
 			return EE_INF;
366 366
 		}
Please login to merge, or discard this patch.
core/db_models/fields/EE_Full_HTML_Field.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * but you want to have an exceptional case where users can directly submit content
12 12
  * for this field, then you should first run the content through `wp_kses( $content, 'post' )`
13 13
  */
14
-class EE_Full_HTML_Field extends EE_Text_Field_Base{
14
+class EE_Full_HTML_Field extends EE_Text_Field_Base {
15 15
 
16 16
 
17 17
 	/**
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 	 * @return string
22 22
 	 */
23 23
 	function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) {
24
-		if($schema =='form_input'){
24
+		if ($schema == 'form_input') {
25 25
 			return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
26
-		}elseif($schema == 'no_wpautop'){
26
+		}elseif ($schema == 'no_wpautop') {
27 27
 			return do_shortcode(parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema));
28
-		}else{
28
+		} else {
29 29
 			return wpautop(do_shortcode(parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema)));
30 30
 		}
31 31
 	}
Please login to merge, or discard this patch.
core/db_models/fields/EE_Post_Content_Field.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,20 +3,20 @@
 block discarded – undo
3 3
  * Field to only allow tags that are normally allowed on post_content:
4 4
  * address,a,abbr,acronym,area,article,aside,b,big,blockquote,br,button,caption,cite,code,col,del,dd,dfn,details,div,dl,dt,em,fieldset,figure,figcaption,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,img,ins,kbd,label,legend,li,map,mark,menu,nav,p,pre,q,s,samp,span,section,small,strike,strong,sub,summary,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,u,ul,ol,var
5 5
  */
6
-class EE_Post_Content_Field extends EE_Text_Field_Base{
6
+class EE_Post_Content_Field extends EE_Text_Field_Base {
7 7
 	/**
8 8
 	 * removes all tags which a WP Post wouldn't allow in its content normally
9 9
 	 * @param string $value
10 10
 	 * @return string
11 11
 	 */
12 12
 	function prepare_for_set($value) {
13
-		if( ! current_user_can( 'unfiltered_html' ) ) {
14
-			$value =  wp_kses("$value",wp_kses_allowed_html( 'post' ));
13
+		if ( ! current_user_can('unfiltered_html')) {
14
+			$value = wp_kses("$value", wp_kses_allowed_html('post'));
15 15
 		}
16 16
 		return parent::prepare_for_set($value);
17 17
 	}
18 18
 	
19
-	function prepare_for_set_from_db($value_found_in_db_for_model_object){
19
+	function prepare_for_set_from_db($value_found_in_db_for_model_object) {
20 20
 		return $value_found_in_db_for_model_object;
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/fields/EE_Email_Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 * @param string $value_inputted_for_field_on_model_object
14 14
 	 * @return string
15 15
 	 */
16
-	function prepare_for_set( $value_inputted_for_field_on_model_object ) {
16
+	function prepare_for_set($value_inputted_for_field_on_model_object) {
17 17
 		if ( ! preg_match(
18 18
 			'/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\.!#$%&\'*+-\/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\-\.\d]+)((\.([a-zA-Z\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}]){2,63})+)$/u',
19 19
 			$value_inputted_for_field_on_model_object
Please login to merge, or discard this patch.
core/db_models/EEM_Question_Option.model.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
25
-require_once( EE_CLASSES . 'EE_Question_Option.class.php');
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once(EE_CLASSES.'EE_Question_Option.class.php');
26 26
 
27 27
 
28 28
 class EEM_Question_Option extends EEM_Soft_Delete_Base {
@@ -30,22 +30,22 @@  discard block
 block discarded – undo
30 30
   	// private instance of the Attendee object
31 31
 	protected static $_instance = NULL;
32 32
 
33
-	protected function __construct( $timezone = NULL ) {
34
-		$this->singular_item = __('Question Option','event_espresso');
35
-		$this->plural_item = __('Question Options','event_espresso');
33
+	protected function __construct($timezone = NULL) {
34
+		$this->singular_item = __('Question Option', 'event_espresso');
35
+		$this->plural_item = __('Question Options', 'event_espresso');
36 36
 
37 37
 		$this->_tables = array(
38
-			'Question_Option'=>new EE_Primary_Table('esp_question_option','QSO_ID')
38
+			'Question_Option'=>new EE_Primary_Table('esp_question_option', 'QSO_ID')
39 39
 		);
40 40
 		$this->_fields = array(
41 41
 			'Question_Option'=>array(
42
-					'QSO_ID'=>new EE_Primary_Key_Int_Field('QSO_ID', __('Question Option ID','event_espresso')),
43
-					'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID','event_espresso'), false, 0, 'Question'),
44
-					'QSO_value'=>new EE_Plain_Text_Field('QSO_value',  __("Question Option Value", "event_espresso"),false,''),
45
-					'QSO_desc'=>new EE_Post_Content_Field('QSO_desc', __('Question Option Description','event_espresso'), false, ''),
46
-					'QSO_order' => new EE_Integer_Field('QSO_order', __('Question Option Order', 'event_espresso' ), false, 0 ),
47
-					'QSO_system'=>new EE_Plain_Text_Field('QSO_system', __('Internal string ID for question option','event_espresso'), TRUE, NULL ),
48
-					'QSO_deleted'=>new EE_Trashed_Flag_Field('QSO_deleted', __('Flag indicating Option was trashed','event_espresso'), false, false)
42
+					'QSO_ID'=>new EE_Primary_Key_Int_Field('QSO_ID', __('Question Option ID', 'event_espresso')),
43
+					'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso'), false, 0, 'Question'),
44
+					'QSO_value'=>new EE_Plain_Text_Field('QSO_value', __("Question Option Value", "event_espresso"), false, ''),
45
+					'QSO_desc'=>new EE_Post_Content_Field('QSO_desc', __('Question Option Description', 'event_espresso'), false, ''),
46
+					'QSO_order' => new EE_Integer_Field('QSO_order', __('Question Option Order', 'event_espresso'), false, 0),
47
+					'QSO_system'=>new EE_Plain_Text_Field('QSO_system', __('Internal string ID for question option', 'event_espresso'), TRUE, NULL),
48
+					'QSO_deleted'=>new EE_Trashed_Flag_Field('QSO_deleted', __('Flag indicating Option was trashed', 'event_espresso'), false, false)
49 49
 				)
50 50
 		);
51 51
 		$this->_model_relations = array(
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 		$this->_model_chain_to_wp_user = 'Question';
56 56
 		//this model is generally available for reading
57
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
58
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('Question_Option');
59
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('Question_Option');
60
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('Question_Option');
57
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
58
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('Question_Option');
59
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('Question_Option');
60
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('Question_Option');
61 61
 		$this->_caps_slug = 'questions';
62
-		parent::__construct( $timezone );
62
+		parent::__construct($timezone);
63 63
 	}
64 64
 
65 65
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.