Completed
Branch BUG-10236-FIX-RESET-CAPABILITI... (cbd980)
by
unknown
26:22 queued 14:04
created
core/db_classes/EE_Ticket.class.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,8 @@
 block discarded – undo
128 128
      *
129 129
      * @param bool        $display   true = we'll return a localized string, otherwise we just return the value of the relevant status const
130 130
      * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing
131
-     * @return mixed status int if the display string isn't requested
131
+     * @param boolean $remaining
132
+     * @return string status int if the display string isn't requested
132 133
      * @throws \EE_Error
133 134
      */
134 135
 	public function ticket_status( $display = FALSE, $remaining = null ) {
Please login to merge, or discard this patch.
Indentation   +582 added lines, -582 removed lines patch added patch discarded remove patch
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
 
62 62
 
63 63
 
64
-    /**
65
-     * @param array  $props_n_values          incoming values
66
-     * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
67
-     *                                        used.)
68
-     * @param array  $date_formats            incoming date_formats in an array where the first value is the
69
-     *                                        date_format and the second value is the time format
70
-     * @return EE_Ticket
71
-     * @throws \EE_Error
72
-     */
64
+	/**
65
+	 * @param array  $props_n_values          incoming values
66
+	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
67
+	 *                                        used.)
68
+	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
69
+	 *                                        date_format and the second value is the time format
70
+	 * @return EE_Ticket
71
+	 * @throws \EE_Error
72
+	 */
73 73
 	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
74 74
 		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
75 75
 		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
@@ -77,36 +77,36 @@  discard block
 block discarded – undo
77 77
 
78 78
 
79 79
 
80
-    /**
81
-     * @param array  $props_n_values  incoming values from the database
82
-     * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
83
-     *                                the website will be used.
84
-     * @return EE_Ticket
85
-     * @throws \EE_Error
86
-     */
80
+	/**
81
+	 * @param array  $props_n_values  incoming values from the database
82
+	 * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
83
+	 *                                the website will be used.
84
+	 * @return EE_Ticket
85
+	 * @throws \EE_Error
86
+	 */
87 87
 	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
88 88
 		return new self( $props_n_values, TRUE, $timezone );
89 89
 	}
90 90
 
91 91
 
92 92
 
93
-    /**
94
-     * @return bool
95
-     * @throws \EE_Error
96
-     */
93
+	/**
94
+	 * @return bool
95
+	 * @throws \EE_Error
96
+	 */
97 97
 	public function parent() {
98 98
 		return $this->get( 'TKT_parent' );
99 99
 	}
100 100
 
101 101
 
102 102
 
103
-    /**
104
-     * return if a ticket has quantities available for purchase
105
-     *
106
-     * @param  int $DTT_ID the primary key for a particular datetime
107
-     * @return boolean
108
-     * @throws \EE_Error
109
-     */
103
+	/**
104
+	 * return if a ticket has quantities available for purchase
105
+	 *
106
+	 * @param  int $DTT_ID the primary key for a particular datetime
107
+	 * @return boolean
108
+	 * @throws \EE_Error
109
+	 */
110 110
 	public function available( $DTT_ID = 0 ) {
111 111
 		// are we checking availability for a particular datetime ?
112 112
 		if ( $DTT_ID ) {
@@ -123,14 +123,14 @@  discard block
 block discarded – undo
123 123
 
124 124
 
125 125
 
126
-    /**
127
-     * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired
128
-     *
129
-     * @param bool        $display   true = we'll return a localized string, otherwise we just return the value of the relevant status const
130
-     * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing
131
-     * @return mixed status int if the display string isn't requested
132
-     * @throws \EE_Error
133
-     */
126
+	/**
127
+	 * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired
128
+	 *
129
+	 * @param bool        $display   true = we'll return a localized string, otherwise we just return the value of the relevant status const
130
+	 * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing
131
+	 * @return mixed status int if the display string isn't requested
132
+	 * @throws \EE_Error
133
+	 */
134 134
 	public function ticket_status( $display = FALSE, $remaining = null ) {
135 135
 		$remaining = is_bool( $remaining ) ? $remaining : $this->is_remaining();
136 136
 		if ( ! $remaining ) {
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
 
154 154
 
155 155
 
156
-    /**
157
-     * The purpose of this method is to simply return a boolean for whether there are any tickets remaining for sale considering ALL the factors used for figuring that out.
158
-     *
159
-     * @access public
160
-     * @param  int $DTT_ID if an int above 0 is included here then we get a specific dtt.
161
-     * @return boolean         true = tickets remaining, false not.
162
-     * @throws \EE_Error
163
-     */
156
+	/**
157
+	 * The purpose of this method is to simply return a boolean for whether there are any tickets remaining for sale considering ALL the factors used for figuring that out.
158
+	 *
159
+	 * @access public
160
+	 * @param  int $DTT_ID if an int above 0 is included here then we get a specific dtt.
161
+	 * @return boolean         true = tickets remaining, false not.
162
+	 * @throws \EE_Error
163
+	 */
164 164
 	public function is_remaining( $DTT_ID = 0 ) {
165 165
 		$num_remaining = $this->remaining( $DTT_ID );
166 166
 		if ( $num_remaining === 0 ) {
@@ -174,76 +174,76 @@  discard block
 block discarded – undo
174 174
 
175 175
 
176 176
 
177
-    /**
178
-     * return the total number of tickets available for purchase
179
-     *
180
-     * @param  int $DTT_ID the primary key for a particular datetime.
181
-     *                     set to 0 for all related datetimes
182
-     * @return int
183
-     * @throws \EE_Error
184
-     */
177
+	/**
178
+	 * return the total number of tickets available for purchase
179
+	 *
180
+	 * @param  int $DTT_ID the primary key for a particular datetime.
181
+	 *                     set to 0 for all related datetimes
182
+	 * @return int
183
+	 * @throws \EE_Error
184
+	 */
185 185
 	public function remaining( $DTT_ID = 0 ) {
186 186
 		return $this->real_quantity_on_ticket('saleable', $DTT_ID );
187 187
 	}
188 188
 
189 189
 
190 190
 
191
-    /**
192
-     * Gets min
193
-     *
194
-     * @return int
195
-     * @throws \EE_Error
196
-     */
191
+	/**
192
+	 * Gets min
193
+	 *
194
+	 * @return int
195
+	 * @throws \EE_Error
196
+	 */
197 197
 	public function min() {
198 198
 		return $this->get( 'TKT_min' );
199 199
 	}
200 200
 
201 201
 
202 202
 
203
-    /**
204
-     * return if a ticket is no longer available cause its available dates have expired.
205
-     *
206
-     * @return boolean
207
-     * @throws \EE_Error
208
-     */
203
+	/**
204
+	 * return if a ticket is no longer available cause its available dates have expired.
205
+	 *
206
+	 * @return boolean
207
+	 * @throws \EE_Error
208
+	 */
209 209
 	public function is_expired() {
210 210
 		return ( $this->get_raw( 'TKT_end_date' ) < time() );
211 211
 	}
212 212
 
213 213
 
214 214
 
215
-    /**
216
-     * Return if a ticket is yet to go on sale or not
217
-     *
218
-     * @return boolean
219
-     * @throws \EE_Error
220
-     */
215
+	/**
216
+	 * Return if a ticket is yet to go on sale or not
217
+	 *
218
+	 * @return boolean
219
+	 * @throws \EE_Error
220
+	 */
221 221
 	public function is_pending() {
222 222
 		return ( $this->get_raw( 'TKT_start_date' ) > time() );
223 223
 	}
224 224
 
225 225
 
226 226
 
227
-    /**
228
-     * Return if a ticket is on sale or not
229
-     *
230
-     * @return boolean
231
-     * @throws \EE_Error
232
-     */
227
+	/**
228
+	 * Return if a ticket is on sale or not
229
+	 *
230
+	 * @return boolean
231
+	 * @throws \EE_Error
232
+	 */
233 233
 	public function is_on_sale() {
234 234
 		return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() );
235 235
 	}
236 236
 
237 237
 
238 238
 
239
-    /**
240
-     * This returns the chronologically last datetime that this ticket is associated with
241
-     *
242
-     * @param string $dt_frmt
243
-     * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31
244
-     * @return string
245
-     * @throws \EE_Error
246
-     */
239
+	/**
240
+	 * This returns the chronologically last datetime that this ticket is associated with
241
+	 *
242
+	 * @param string $dt_frmt
243
+	 * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31
244
+	 * @return string
245
+	 * @throws \EE_Error
246
+	 */
247 247
 	public function date_range( $dt_frmt = '', $conjunction = ' - ' ) {
248 248
 		$first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date( $dt_frmt ) : '';
249 249
 		$last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date( $dt_frmt ) : '';
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
 
254 254
 
255 255
 
256
-    /**
257
-     * This returns the chronologically first datetime that this ticket is associated with
258
-     *
259
-     * @return EE_Datetime
260
-     * @throws \EE_Error
261
-     */
256
+	/**
257
+	 * This returns the chronologically first datetime that this ticket is associated with
258
+	 *
259
+	 * @return EE_Datetime
260
+	 * @throws \EE_Error
261
+	 */
262 262
 	public function first_datetime() {
263 263
 		$datetimes = $this->datetimes( array( 'limit' => 1 ) );
264 264
 		return reset( $datetimes );
@@ -266,14 +266,14 @@  discard block
 block discarded – undo
266 266
 
267 267
 
268 268
 
269
-    /**
270
-     * Gets all the datetimes this ticket can be used for attending.
271
-     * Unless otherwise specified, orders datetimes by start date.
272
-     *
273
-     * @param array $query_params see EEM_Base::get_all()
274
-     * @return EE_Datetime[]|EE_Base_Class[]
275
-     * @throws \EE_Error
276
-     */
269
+	/**
270
+	 * Gets all the datetimes this ticket can be used for attending.
271
+	 * Unless otherwise specified, orders datetimes by start date.
272
+	 *
273
+	 * @param array $query_params see EEM_Base::get_all()
274
+	 * @return EE_Datetime[]|EE_Base_Class[]
275
+	 * @throws \EE_Error
276
+	 */
277 277
 	public function datetimes( $query_params = array() ) {
278 278
 		if ( ! isset( $query_params[ 'order_by' ] ) ) {
279 279
 			$query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC';
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
 
284 284
 
285 285
 
286
-    /**
287
-     * This returns the chronologically last datetime that this ticket is associated with
288
-     *
289
-     * @return EE_Datetime
290
-     * @throws \EE_Error
291
-     */
286
+	/**
287
+	 * This returns the chronologically last datetime that this ticket is associated with
288
+	 *
289
+	 * @return EE_Datetime
290
+	 * @throws \EE_Error
291
+	 */
292 292
 	public function last_datetime() {
293 293
 		$datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) );
294 294
 		return end( $datetimes );
@@ -296,19 +296,19 @@  discard block
 block discarded – undo
296 296
 
297 297
 
298 298
 
299
-    /**
300
-     * This returns the total tickets sold depending on the given parameters.
301
-     *
302
-     * @param  string $what   Can be one of two options: 'ticket', 'datetime'.
303
-     *                        'ticket' = total ticket sales for all datetimes this ticket is related to
304
-     *                        'datetime' = total ticket sales for a specified datetime (required $dtt_id)
305
-     *                        'datetime' = total ticket sales in the datetime_ticket table.
306
-     *                        If $dtt_id is not given then we return an array of sales indexed by datetime.
307
-     *                        If $dtt_id IS given then we return the tickets sold for that given datetime.
308
-     * @param  int    $dtt_id [optional] include the dtt_id with $what = 'datetime'.
309
-     * @return mixed (array|int)          how many tickets have sold
310
-     * @throws \EE_Error
311
-     */
299
+	/**
300
+	 * This returns the total tickets sold depending on the given parameters.
301
+	 *
302
+	 * @param  string $what   Can be one of two options: 'ticket', 'datetime'.
303
+	 *                        'ticket' = total ticket sales for all datetimes this ticket is related to
304
+	 *                        'datetime' = total ticket sales for a specified datetime (required $dtt_id)
305
+	 *                        'datetime' = total ticket sales in the datetime_ticket table.
306
+	 *                        If $dtt_id is not given then we return an array of sales indexed by datetime.
307
+	 *                        If $dtt_id IS given then we return the tickets sold for that given datetime.
308
+	 * @param  int    $dtt_id [optional] include the dtt_id with $what = 'datetime'.
309
+	 * @return mixed (array|int)          how many tickets have sold
310
+	 * @throws \EE_Error
311
+	 */
312 312
 	public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) {
313 313
 		$total = 0;
314 314
 		$tickets_sold = $this->_all_tickets_sold();
@@ -333,12 +333,12 @@  discard block
 block discarded – undo
333 333
 
334 334
 
335 335
 
336
-    /**
337
-     * This returns an array indexed by datetime_id for tickets sold with this ticket.
338
-     *
339
-     * @return EE_Ticket[]
340
-     * @throws \EE_Error
341
-     */
336
+	/**
337
+	 * This returns an array indexed by datetime_id for tickets sold with this ticket.
338
+	 *
339
+	 * @return EE_Ticket[]
340
+	 * @throws \EE_Error
341
+	 */
342 342
 	protected function _all_tickets_sold() {
343 343
 		$datetimes = $this->get_many_related( 'Datetime' );
344 344
 		$tickets_sold = array();
@@ -354,29 +354,29 @@  discard block
 block discarded – undo
354 354
 
355 355
 
356 356
 
357
-    /**
358
-     * This returns the base price object for the ticket.
359
-     *
360
-     * @param  bool $return_array whether to return as an array indexed by price id or just the object.
361
-     * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[]
362
-     * @throws \EE_Error
363
-     */
357
+	/**
358
+	 * This returns the base price object for the ticket.
359
+	 *
360
+	 * @param  bool $return_array whether to return as an array indexed by price id or just the object.
361
+	 * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[]
362
+	 * @throws \EE_Error
363
+	 */
364 364
 	public function base_price( $return_array = FALSE ) {
365 365
 		$_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price );
366 366
 		return $return_array
367
-            ? $this->get_many_related( 'Price', array( $_where ) )
368
-            : $this->get_first_related( 'Price', array( $_where ) );
367
+			? $this->get_many_related( 'Price', array( $_where ) )
368
+			: $this->get_first_related( 'Price', array( $_where ) );
369 369
 	}
370 370
 
371 371
 
372 372
 
373
-    /**
374
-     * This returns ONLY the price modifiers for the ticket (i.e. no taxes or base price)
375
-     *
376
-     * @access public
377
-     * @return EE_Price[]
378
-     * @throws \EE_Error
379
-     */
373
+	/**
374
+	 * This returns ONLY the price modifiers for the ticket (i.e. no taxes or base price)
375
+	 *
376
+	 * @access public
377
+	 * @return EE_Price[]
378
+	 * @throws \EE_Error
379
+	 */
380 380
 	public function price_modifiers() {
381 381
 		$query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) );
382 382
 		return $this->prices( $query_params );
@@ -384,132 +384,132 @@  discard block
 block discarded – undo
384 384
 
385 385
 
386 386
 
387
-    /**
388
-     * Gets all the prices that combine to form the final price of this ticket
389
-     *
390
-     * @param array $query_params like EEM_Base::get_all
391
-     * @return EE_Price[]|EE_Base_Class[]
392
-     * @throws \EE_Error
393
-     */
387
+	/**
388
+	 * Gets all the prices that combine to form the final price of this ticket
389
+	 *
390
+	 * @param array $query_params like EEM_Base::get_all
391
+	 * @return EE_Price[]|EE_Base_Class[]
392
+	 * @throws \EE_Error
393
+	 */
394 394
 	public function prices( $query_params = array() ) {
395 395
 		return $this->get_many_related( 'Price', $query_params );
396 396
 	}
397 397
 
398 398
 
399 399
 
400
-    /**
401
-     * Gets all the ticket applicabilities (ie, relations between datetimes and tickets)
402
-     *
403
-     * @param array $query_params see EEM_Base::get_all()
404
-     * @return EE_Datetime_Ticket|EE_Base_Class[]
405
-     * @throws \EE_Error
406
-     */
400
+	/**
401
+	 * Gets all the ticket applicabilities (ie, relations between datetimes and tickets)
402
+	 *
403
+	 * @param array $query_params see EEM_Base::get_all()
404
+	 * @return EE_Datetime_Ticket|EE_Base_Class[]
405
+	 * @throws \EE_Error
406
+	 */
407 407
 	public function datetime_tickets( $query_params = array() ) {
408 408
 		return $this->get_many_related( 'Datetime_Ticket', $query_params );
409 409
 	}
410 410
 
411 411
 
412 412
 
413
-    /**
414
-     * Gets all the datetimes from the db ordered by DTT_order
415
-     *
416
-     * @param boolean $show_expired
417
-     * @param boolean $show_deleted
418
-     * @return EE_Datetime[]
419
-     * @throws \EE_Error
420
-     */
413
+	/**
414
+	 * Gets all the datetimes from the db ordered by DTT_order
415
+	 *
416
+	 * @param boolean $show_expired
417
+	 * @param boolean $show_deleted
418
+	 * @return EE_Datetime[]
419
+	 * @throws \EE_Error
420
+	 */
421 421
 	public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) {
422 422
 		return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted );
423 423
 	}
424 424
 
425 425
 
426 426
 
427
-    /**
428
-     * Gets ID
429
-     *
430
-     * @return string
431
-     * @throws \EE_Error
432
-     */
427
+	/**
428
+	 * Gets ID
429
+	 *
430
+	 * @return string
431
+	 * @throws \EE_Error
432
+	 */
433 433
 	public function ID() {
434 434
 		return $this->get( 'TKT_ID' );
435 435
 	}
436 436
 
437 437
 
438 438
 
439
-    /**
440
-     * get the author of the ticket.
441
-     *
442
-     * @since 4.5.0
443
-     * @return int
444
-     * @throws \EE_Error
445
-     */
439
+	/**
440
+	 * get the author of the ticket.
441
+	 *
442
+	 * @since 4.5.0
443
+	 * @return int
444
+	 * @throws \EE_Error
445
+	 */
446 446
 	public function wp_user() {
447 447
 		return $this->get('TKT_wp_user');
448 448
 	}
449 449
 
450 450
 
451 451
 
452
-    /**
453
-     * Gets the template for the ticket
454
-     *
455
-     * @return EE_Ticket_Template|EE_Base_Class
456
-     * @throws \EE_Error
457
-     */
452
+	/**
453
+	 * Gets the template for the ticket
454
+	 *
455
+	 * @return EE_Ticket_Template|EE_Base_Class
456
+	 * @throws \EE_Error
457
+	 */
458 458
 	public function template() {
459 459
 		return $this->get_first_related( 'Ticket_Template' );
460 460
 	}
461 461
 
462 462
 
463 463
 
464
-    /**
465
-     * Simply returns an array of EE_Price objects that are taxes.
466
-     *
467
-     * @return EE_Price[]
468
-     * @throws \EE_Error
469
-     */
464
+	/**
465
+	 * Simply returns an array of EE_Price objects that are taxes.
466
+	 *
467
+	 * @return EE_Price[]
468
+	 * @throws \EE_Error
469
+	 */
470 470
 	public function get_ticket_taxes_for_admin() {
471 471
 		return EE_Taxes::get_taxes_for_admin();
472 472
 	}
473 473
 
474 474
 
475 475
 
476
-    /**
477
-     * @return float
478
-     * @throws \EE_Error
479
-     */
476
+	/**
477
+	 * @return float
478
+	 * @throws \EE_Error
479
+	 */
480 480
 	public function ticket_price() {
481 481
 		return $this->get( 'TKT_price' );
482 482
 	}
483 483
 
484 484
 
485 485
 
486
-    /**
487
-     * @return mixed
488
-     * @throws \EE_Error
489
-     */
486
+	/**
487
+	 * @return mixed
488
+	 * @throws \EE_Error
489
+	 */
490 490
 	public function pretty_price() {
491 491
 		return $this->get_pretty( 'TKT_price' );
492 492
 	}
493 493
 
494 494
 
495 495
 
496
-    /**
497
-     * @return bool
498
-     * @throws \EE_Error
499
-     */
496
+	/**
497
+	 * @return bool
498
+	 * @throws \EE_Error
499
+	 */
500 500
 	public function is_free() {
501 501
 		return $this->get_ticket_total_with_taxes() === (float) 0;
502 502
 	}
503 503
 
504 504
 
505 505
 
506
-    /**
507
-     * get_ticket_total_with_taxes
508
-     *
509
-     * @param bool $no_cache
510
-     * @return float
511
-     * @throws \EE_Error
512
-     */
506
+	/**
507
+	 * get_ticket_total_with_taxes
508
+	 *
509
+	 * @param bool $no_cache
510
+	 * @return float
511
+	 * @throws \EE_Error
512
+	 */
513 513
 	public function get_ticket_total_with_taxes( $no_cache = FALSE ) {
514 514
 		if ($this->_ticket_total_with_taxes === null || $no_cache ) {
515 515
 			$this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin();
@@ -526,201 +526,201 @@  discard block
 block discarded – undo
526 526
 
527 527
 
528 528
 
529
-    /**
530
-     * @return float
531
-     * @throws \EE_Error
532
-     */
529
+	/**
530
+	 * @return float
531
+	 * @throws \EE_Error
532
+	 */
533 533
 	public function get_ticket_subtotal() {
534 534
 		return EE_Taxes::get_subtotal_for_admin( $this );
535 535
 	}
536 536
 
537 537
 
538 538
 
539
-    /**
540
-     * Returns the total taxes applied to this ticket
541
-     *
542
-     * @return float
543
-     * @throws \EE_Error
544
-     */
539
+	/**
540
+	 * Returns the total taxes applied to this ticket
541
+	 *
542
+	 * @return float
543
+	 * @throws \EE_Error
544
+	 */
545 545
 	public function get_ticket_taxes_total_for_admin() {
546 546
 		return EE_Taxes::get_total_taxes_for_admin( $this );
547 547
 	}
548 548
 
549 549
 
550 550
 
551
-    /**
552
-     * Sets name
553
-     *
554
-     * @param string $name
555
-     * @throws \EE_Error
556
-     */
551
+	/**
552
+	 * Sets name
553
+	 *
554
+	 * @param string $name
555
+	 * @throws \EE_Error
556
+	 */
557 557
 	public function set_name( $name ) {
558 558
 		$this->set( 'TKT_name', $name );
559 559
 	}
560 560
 
561 561
 
562 562
 
563
-    /**
564
-     * Gets description
565
-     *
566
-     * @return string
567
-     * @throws \EE_Error
568
-     */
563
+	/**
564
+	 * Gets description
565
+	 *
566
+	 * @return string
567
+	 * @throws \EE_Error
568
+	 */
569 569
 	public function description() {
570 570
 		return $this->get( 'TKT_description' );
571 571
 	}
572 572
 
573 573
 
574 574
 
575
-    /**
576
-     * Sets description
577
-     *
578
-     * @param string $description
579
-     * @throws \EE_Error
580
-     */
575
+	/**
576
+	 * Sets description
577
+	 *
578
+	 * @param string $description
579
+	 * @throws \EE_Error
580
+	 */
581 581
 	public function set_description( $description ) {
582 582
 		$this->set( 'TKT_description', $description );
583 583
 	}
584 584
 
585 585
 
586 586
 
587
-    /**
588
-     * Gets start_date
589
-     *
590
-     * @param string $dt_frmt
591
-     * @param string $tm_frmt
592
-     * @return string
593
-     * @throws \EE_Error
594
-     */
587
+	/**
588
+	 * Gets start_date
589
+	 *
590
+	 * @param string $dt_frmt
591
+	 * @param string $tm_frmt
592
+	 * @return string
593
+	 * @throws \EE_Error
594
+	 */
595 595
 	public function start_date( $dt_frmt = '', $tm_frmt = '' ) {
596 596
 		return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt );
597 597
 	}
598 598
 
599 599
 
600 600
 
601
-    /**
602
-     * Sets start_date
603
-     *
604
-     * @param string $start_date
605
-     * @return void
606
-     * @throws \EE_Error
607
-     */
601
+	/**
602
+	 * Sets start_date
603
+	 *
604
+	 * @param string $start_date
605
+	 * @return void
606
+	 * @throws \EE_Error
607
+	 */
608 608
 	public function set_start_date( $start_date ) {
609 609
 		$this->_set_date_time( 'B', $start_date, 'TKT_start_date' );
610 610
 	}
611 611
 
612 612
 
613 613
 
614
-    /**
615
-     * Gets end_date
616
-     *
617
-     * @param string $dt_frmt
618
-     * @param string $tm_frmt
619
-     * @return string
620
-     * @throws \EE_Error
621
-     */
614
+	/**
615
+	 * Gets end_date
616
+	 *
617
+	 * @param string $dt_frmt
618
+	 * @param string $tm_frmt
619
+	 * @return string
620
+	 * @throws \EE_Error
621
+	 */
622 622
 	public function end_date( $dt_frmt = '', $tm_frmt = '' ) {
623 623
 		return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt );
624 624
 	}
625 625
 
626 626
 
627 627
 
628
-    /**
629
-     * Sets end_date
630
-     *
631
-     * @param string $end_date
632
-     * @return void
633
-     * @throws \EE_Error
634
-     */
628
+	/**
629
+	 * Sets end_date
630
+	 *
631
+	 * @param string $end_date
632
+	 * @return void
633
+	 * @throws \EE_Error
634
+	 */
635 635
 	public function set_end_date( $end_date ) {
636 636
 		$this->_set_date_time( 'B', $end_date, 'TKT_end_date' );
637 637
 	}
638 638
 
639 639
 
640 640
 
641
-    /**
642
-     * Sets sell until time
643
-     *
644
-     * @since 4.5.0
645
-     * @param string $time a string representation of the sell until time (ex 9am or 7:30pm)
646
-     * @throws \EE_Error
647
-     */
641
+	/**
642
+	 * Sets sell until time
643
+	 *
644
+	 * @since 4.5.0
645
+	 * @param string $time a string representation of the sell until time (ex 9am or 7:30pm)
646
+	 * @throws \EE_Error
647
+	 */
648 648
 	public function set_end_time( $time ) {
649 649
 		$this->_set_time_for( $time, 'TKT_end_date' );
650 650
 	}
651 651
 
652 652
 
653 653
 
654
-    /**
655
-     * Sets min
656
-     *
657
-     * @param int $min
658
-     * @return void
659
-     * @throws \EE_Error
660
-     */
654
+	/**
655
+	 * Sets min
656
+	 *
657
+	 * @param int $min
658
+	 * @return void
659
+	 * @throws \EE_Error
660
+	 */
661 661
 	public function set_min( $min ) {
662 662
 		$this->set( 'TKT_min', $min );
663 663
 	}
664 664
 
665 665
 
666 666
 
667
-    /**
668
-     * Gets max
669
-     *
670
-     * @return int
671
-     * @throws \EE_Error
672
-     */
667
+	/**
668
+	 * Gets max
669
+	 *
670
+	 * @return int
671
+	 * @throws \EE_Error
672
+	 */
673 673
 	public function max() {
674 674
 		return $this->get( 'TKT_max' );
675 675
 	}
676 676
 
677 677
 
678 678
 
679
-    /**
680
-     * Sets max
681
-     *
682
-     * @param int $max
683
-     * @return void
684
-     * @throws \EE_Error
685
-     */
679
+	/**
680
+	 * Sets max
681
+	 *
682
+	 * @param int $max
683
+	 * @return void
684
+	 * @throws \EE_Error
685
+	 */
686 686
 	public function set_max( $max ) {
687 687
 		$this->set( 'TKT_max', $max );
688 688
 	}
689 689
 
690 690
 
691 691
 
692
-    /**
693
-     * Sets price
694
-     *
695
-     * @param float $price
696
-     * @return void
697
-     * @throws \EE_Error
698
-     */
692
+	/**
693
+	 * Sets price
694
+	 *
695
+	 * @param float $price
696
+	 * @return void
697
+	 * @throws \EE_Error
698
+	 */
699 699
 	public function set_price( $price ) {
700 700
 		$this->set( 'TKT_price', $price );
701 701
 	}
702 702
 
703 703
 
704 704
 
705
-    /**
706
-     * Gets sold
707
-     *
708
-     * @return int
709
-     * @throws \EE_Error
710
-     */
705
+	/**
706
+	 * Gets sold
707
+	 *
708
+	 * @return int
709
+	 * @throws \EE_Error
710
+	 */
711 711
 	public function sold() {
712 712
 		return $this->get_raw( 'TKT_sold' );
713 713
 	}
714 714
 
715 715
 
716 716
 
717
-    /**
718
-     * Sets sold
719
-     *
720
-     * @param int $sold
721
-     * @return void
722
-     * @throws \EE_Error
723
-     */
717
+	/**
718
+	 * Sets sold
719
+	 *
720
+	 * @param int $sold
721
+	 * @return void
722
+	 * @throws \EE_Error
723
+	 */
724 724
 	public function set_sold( $sold ) {
725 725
 		// sold can not go below zero
726 726
 		$sold = max( 0, $sold );
@@ -729,13 +729,13 @@  discard block
 block discarded – undo
729 729
 
730 730
 
731 731
 
732
-    /**
733
-     * increments sold by amount passed by $qty
734
-     *
735
-     * @param int $qty
736
-     * @return void
737
-     * @throws \EE_Error
738
-     */
732
+	/**
733
+	 * increments sold by amount passed by $qty
734
+	 *
735
+	 * @param int $qty
736
+	 * @return void
737
+	 * @throws \EE_Error
738
+	 */
739 739
 	public function increase_sold( $qty = 1 ) {
740 740
 		$sold = $this->sold() + $qty;
741 741
 		// remove ticket reservation, but don't adjust datetime reservations,  because that will happen
@@ -747,13 +747,13 @@  discard block
 block discarded – undo
747 747
 
748 748
 
749 749
 
750
-    /**
751
-     * Increases sold on related datetimes
752
-     *
753
-     * @param int $qty
754
-     * @return void
755
-     * @throws \EE_Error
756
-     */
750
+	/**
751
+	 * Increases sold on related datetimes
752
+	 *
753
+	 * @param int $qty
754
+	 * @return void
755
+	 * @throws \EE_Error
756
+	 */
757 757
 	protected function _increase_sold_for_datetimes( $qty = 1 ) {
758 758
 		$datetimes = $this->datetimes();
759 759
 		if ( is_array( $datetimes ) ) {
@@ -768,13 +768,13 @@  discard block
 block discarded – undo
768 768
 
769 769
 
770 770
 
771
-    /**
772
-     * decrements (subtracts) sold by amount passed by $qty
773
-     *
774
-     * @param int $qty
775
-     * @return void
776
-     * @throws \EE_Error
777
-     */
771
+	/**
772
+	 * decrements (subtracts) sold by amount passed by $qty
773
+	 *
774
+	 * @param int $qty
775
+	 * @return void
776
+	 * @throws \EE_Error
777
+	 */
778 778
 	public function decrease_sold( $qty = 1 ) {
779 779
 		$sold = $this->sold() - $qty;
780 780
 		$this->_decrease_sold_for_datetimes( $qty );
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
 
784 784
 
785 785
 
786
-    /**
787
-     * Decreases sold on related datetimes
788
-     *
789
-     * @param int $qty
790
-     * @return void
791
-     * @throws \EE_Error
792
-     */
786
+	/**
787
+	 * Decreases sold on related datetimes
788
+	 *
789
+	 * @param int $qty
790
+	 * @return void
791
+	 * @throws \EE_Error
792
+	 */
793 793
 	protected function _decrease_sold_for_datetimes( $qty = 1 ) {
794 794
 		$datetimes = $this->datetimes();
795 795
 		if ( is_array( $datetimes ) ) {
@@ -804,25 +804,25 @@  discard block
 block discarded – undo
804 804
 
805 805
 
806 806
 
807
-    /**
808
-     * Gets qty of reserved tickets
809
-     *
810
-     * @return int
811
-     * @throws \EE_Error
812
-     */
807
+	/**
808
+	 * Gets qty of reserved tickets
809
+	 *
810
+	 * @return int
811
+	 * @throws \EE_Error
812
+	 */
813 813
 	public function reserved() {
814 814
 		return $this->get_raw( 'TKT_reserved' );
815 815
 	}
816 816
 
817 817
 
818 818
 
819
-    /**
820
-     * Sets reserved
821
-     *
822
-     * @param int $reserved
823
-     * @return void
824
-     * @throws \EE_Error
825
-     */
819
+	/**
820
+	 * Sets reserved
821
+	 *
822
+	 * @param int $reserved
823
+	 * @return void
824
+	 * @throws \EE_Error
825
+	 */
826 826
 	public function set_reserved( $reserved ) {
827 827
 		// reserved can not go below zero
828 828
 		$reserved = max( 0, (int) $reserved );
@@ -831,13 +831,13 @@  discard block
 block discarded – undo
831 831
 
832 832
 
833 833
 
834
-    /**
835
-     * increments reserved by amount passed by $qty
836
-     *
837
-     * @param int $qty
838
-     * @return void
839
-     * @throws \EE_Error
840
-     */
834
+	/**
835
+	 * increments reserved by amount passed by $qty
836
+	 *
837
+	 * @param int $qty
838
+	 * @return void
839
+	 * @throws \EE_Error
840
+	 */
841 841
 	public function increase_reserved( $qty = 1 ) {
842 842
 		$qty = absint( $qty );
843 843
 		$reserved = $this->reserved() + $qty;
@@ -847,13 +847,13 @@  discard block
 block discarded – undo
847 847
 
848 848
 
849 849
 
850
-    /**
851
-     * Increases sold on related datetimes
852
-     *
853
-     * @param int $qty
854
-     * @return void
855
-     * @throws \EE_Error
856
-     */
850
+	/**
851
+	 * Increases sold on related datetimes
852
+	 *
853
+	 * @param int $qty
854
+	 * @return void
855
+	 * @throws \EE_Error
856
+	 */
857 857
 	protected function _increase_reserved_for_datetimes( $qty = 1 ) {
858 858
 		$datetimes = $this->datetimes();
859 859
 		if ( is_array( $datetimes ) ) {
@@ -868,14 +868,14 @@  discard block
 block discarded – undo
868 868
 
869 869
 
870 870
 
871
-    /**
872
-     * decrements (subtracts) reserved by amount passed by $qty
873
-     *
874
-     * @param int  $qty
875
-     * @param bool $adjust_datetimes
876
-     * @return void
877
-     * @throws \EE_Error
878
-     */
871
+	/**
872
+	 * decrements (subtracts) reserved by amount passed by $qty
873
+	 *
874
+	 * @param int  $qty
875
+	 * @param bool $adjust_datetimes
876
+	 * @return void
877
+	 * @throws \EE_Error
878
+	 */
879 879
 	public function decrease_reserved( $qty = 1, $adjust_datetimes = true ) {
880 880
 		$reserved = $this->reserved() - absint( $qty );
881 881
 		if ( $adjust_datetimes ) {
@@ -886,13 +886,13 @@  discard block
 block discarded – undo
886 886
 
887 887
 
888 888
 
889
-    /**
890
-     * Increases sold on related datetimes
891
-     *
892
-     * @param int $qty
893
-     * @return void
894
-     * @throws \EE_Error
895
-     */
889
+	/**
890
+	 * Increases sold on related datetimes
891
+	 *
892
+	 * @param int $qty
893
+	 * @return void
894
+	 * @throws \EE_Error
895
+	 */
896 896
 	protected function _decrease_reserved_for_datetimes( $qty = 1 ) {
897 897
 		$datetimes = $this->datetimes();
898 898
 		if ( is_array( $datetimes ) ) {
@@ -907,18 +907,18 @@  discard block
 block discarded – undo
907 907
 
908 908
 
909 909
 
910
-    /**
911
-     * Gets ticket quantity
912
-     *
913
-     * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
914
-     *                            therefore $context can be one of three values: '', 'reg_limit', or 'saleable'
915
-     *                            '' (default) quantity is the actual db value for TKT_qty, unaffected by other objects
916
-     *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
917
-     *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
918
-     *                            is therefore the truest measure of tickets that can be purchased at the moment
919
-     * @return int
920
-     * @throws \EE_Error
921
-     */
910
+	/**
911
+	 * Gets ticket quantity
912
+	 *
913
+	 * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
914
+	 *                            therefore $context can be one of three values: '', 'reg_limit', or 'saleable'
915
+	 *                            '' (default) quantity is the actual db value for TKT_qty, unaffected by other objects
916
+	 *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
917
+	 *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
918
+	 *                            is therefore the truest measure of tickets that can be purchased at the moment
919
+	 * @return int
920
+	 * @throws \EE_Error
921
+	 */
922 922
 	public function qty( $context = '' ) {
923 923
 		switch ( $context ) {
924 924
 			case 'reg_limit' :
@@ -932,19 +932,19 @@  discard block
 block discarded – undo
932 932
 
933 933
 
934 934
 
935
-    /**
936
-     * Gets ticket quantity
937
-     *
938
-     * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
939
-     *                            therefore $context can be one of two values: 'reg_limit', or 'saleable'
940
-     *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
941
-     *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
942
-     *                            is therefore the truest measure of tickets that can be purchased at the moment
943
-     * @param  int   $DTT_ID      the primary key for a particular datetime.
944
-     *                            set to 0 for all related datetimes
945
-     * @return int
946
-     * @throws \EE_Error
947
-     */
935
+	/**
936
+	 * Gets ticket quantity
937
+	 *
938
+	 * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
939
+	 *                            therefore $context can be one of two values: 'reg_limit', or 'saleable'
940
+	 *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
941
+	 *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
942
+	 *                            is therefore the truest measure of tickets that can be purchased at the moment
943
+	 * @param  int   $DTT_ID      the primary key for a particular datetime.
944
+	 *                            set to 0 for all related datetimes
945
+	 * @return int
946
+	 * @throws \EE_Error
947
+	 */
948 948
 	public function real_quantity_on_ticket( $context = 'reg_limit', $DTT_ID = 0 ) {
949 949
 		$raw = $this->get_raw( 'TKT_qty' );
950 950
 		// return immediately if it's zero
@@ -1027,212 +1027,212 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
 
1029 1029
 
1030
-    /**
1031
-     * Gets uses
1032
-     *
1033
-     * @return int
1034
-     * @throws \EE_Error
1035
-     */
1030
+	/**
1031
+	 * Gets uses
1032
+	 *
1033
+	 * @return int
1034
+	 * @throws \EE_Error
1035
+	 */
1036 1036
 	public function uses() {
1037 1037
 		return $this->get( 'TKT_uses' );
1038 1038
 	}
1039 1039
 
1040 1040
 
1041 1041
 
1042
-    /**
1043
-     * Sets uses
1044
-     *
1045
-     * @param int $uses
1046
-     * @return void
1047
-     * @throws \EE_Error
1048
-     */
1042
+	/**
1043
+	 * Sets uses
1044
+	 *
1045
+	 * @param int $uses
1046
+	 * @return void
1047
+	 * @throws \EE_Error
1048
+	 */
1049 1049
 	public function set_uses( $uses ) {
1050 1050
 		$this->set( 'TKT_uses', $uses );
1051 1051
 	}
1052 1052
 
1053 1053
 
1054 1054
 
1055
-    /**
1056
-     * returns whether ticket is required or not.
1057
-     *
1058
-     * @return boolean
1059
-     * @throws \EE_Error
1060
-     */
1055
+	/**
1056
+	 * returns whether ticket is required or not.
1057
+	 *
1058
+	 * @return boolean
1059
+	 * @throws \EE_Error
1060
+	 */
1061 1061
 	public function required() {
1062 1062
 		return $this->get( 'TKT_required' );
1063 1063
 	}
1064 1064
 
1065 1065
 
1066 1066
 
1067
-    /**
1068
-     * sets the TKT_required property
1069
-     *
1070
-     * @param boolean $required
1071
-     * @return void
1072
-     * @throws \EE_Error
1073
-     */
1067
+	/**
1068
+	 * sets the TKT_required property
1069
+	 *
1070
+	 * @param boolean $required
1071
+	 * @return void
1072
+	 * @throws \EE_Error
1073
+	 */
1074 1074
 	public function set_required( $required ) {
1075 1075
 		$this->set( 'TKT_required', $required );
1076 1076
 	}
1077 1077
 
1078 1078
 
1079 1079
 
1080
-    /**
1081
-     * Gets taxable
1082
-     *
1083
-     * @return boolean
1084
-     * @throws \EE_Error
1085
-     */
1080
+	/**
1081
+	 * Gets taxable
1082
+	 *
1083
+	 * @return boolean
1084
+	 * @throws \EE_Error
1085
+	 */
1086 1086
 	public function taxable() {
1087 1087
 		return $this->get( 'TKT_taxable' );
1088 1088
 	}
1089 1089
 
1090 1090
 
1091 1091
 
1092
-    /**
1093
-     * Sets taxable
1094
-     *
1095
-     * @param boolean $taxable
1096
-     * @return void
1097
-     * @throws \EE_Error
1098
-     */
1092
+	/**
1093
+	 * Sets taxable
1094
+	 *
1095
+	 * @param boolean $taxable
1096
+	 * @return void
1097
+	 * @throws \EE_Error
1098
+	 */
1099 1099
 	public function set_taxable( $taxable ) {
1100 1100
 		$this->set( 'TKT_taxable', $taxable );
1101 1101
 	}
1102 1102
 
1103 1103
 
1104 1104
 
1105
-    /**
1106
-     * Gets is_default
1107
-     *
1108
-     * @return boolean
1109
-     * @throws \EE_Error
1110
-     */
1105
+	/**
1106
+	 * Gets is_default
1107
+	 *
1108
+	 * @return boolean
1109
+	 * @throws \EE_Error
1110
+	 */
1111 1111
 	public function is_default() {
1112 1112
 		return $this->get( 'TKT_is_default' );
1113 1113
 	}
1114 1114
 
1115 1115
 
1116 1116
 
1117
-    /**
1118
-     * Sets is_default
1119
-     *
1120
-     * @param boolean $is_default
1121
-     * @return void
1122
-     * @throws \EE_Error
1123
-     */
1117
+	/**
1118
+	 * Sets is_default
1119
+	 *
1120
+	 * @param boolean $is_default
1121
+	 * @return void
1122
+	 * @throws \EE_Error
1123
+	 */
1124 1124
 	public function set_is_default( $is_default ) {
1125 1125
 		$this->set( 'TKT_is_default', $is_default );
1126 1126
 	}
1127 1127
 
1128 1128
 
1129 1129
 
1130
-    /**
1131
-     * Gets order
1132
-     *
1133
-     * @return int
1134
-     * @throws \EE_Error
1135
-     */
1130
+	/**
1131
+	 * Gets order
1132
+	 *
1133
+	 * @return int
1134
+	 * @throws \EE_Error
1135
+	 */
1136 1136
 	public function order() {
1137 1137
 		return $this->get( 'TKT_order' );
1138 1138
 	}
1139 1139
 
1140 1140
 
1141 1141
 
1142
-    /**
1143
-     * Sets order
1144
-     *
1145
-     * @param int $order
1146
-     * @return void
1147
-     * @throws \EE_Error
1148
-     */
1142
+	/**
1143
+	 * Sets order
1144
+	 *
1145
+	 * @param int $order
1146
+	 * @return void
1147
+	 * @throws \EE_Error
1148
+	 */
1149 1149
 	public function set_order( $order ) {
1150 1150
 		$this->set( 'TKT_order', $order );
1151 1151
 	}
1152 1152
 
1153 1153
 
1154 1154
 
1155
-    /**
1156
-     * Gets row
1157
-     *
1158
-     * @return int
1159
-     * @throws \EE_Error
1160
-     */
1155
+	/**
1156
+	 * Gets row
1157
+	 *
1158
+	 * @return int
1159
+	 * @throws \EE_Error
1160
+	 */
1161 1161
 	public function row() {
1162 1162
 		return $this->get( 'TKT_row' );
1163 1163
 	}
1164 1164
 
1165 1165
 
1166 1166
 
1167
-    /**
1168
-     * Sets row
1169
-     *
1170
-     * @param int $row
1171
-     * @return void
1172
-     * @throws \EE_Error
1173
-     */
1167
+	/**
1168
+	 * Sets row
1169
+	 *
1170
+	 * @param int $row
1171
+	 * @return void
1172
+	 * @throws \EE_Error
1173
+	 */
1174 1174
 	public function set_row( $row ) {
1175 1175
 		$this->set( 'TKT_row', $row );
1176 1176
 	}
1177 1177
 
1178 1178
 
1179 1179
 
1180
-    /**
1181
-     * Gets deleted
1182
-     *
1183
-     * @return boolean
1184
-     * @throws \EE_Error
1185
-     */
1180
+	/**
1181
+	 * Gets deleted
1182
+	 *
1183
+	 * @return boolean
1184
+	 * @throws \EE_Error
1185
+	 */
1186 1186
 	public function deleted() {
1187 1187
 		return $this->get( 'TKT_deleted' );
1188 1188
 	}
1189 1189
 
1190 1190
 
1191 1191
 
1192
-    /**
1193
-     * Sets deleted
1194
-     *
1195
-     * @param boolean $deleted
1196
-     * @return void
1197
-     * @throws \EE_Error
1198
-     */
1192
+	/**
1193
+	 * Sets deleted
1194
+	 *
1195
+	 * @param boolean $deleted
1196
+	 * @return void
1197
+	 * @throws \EE_Error
1198
+	 */
1199 1199
 	public function set_deleted( $deleted ) {
1200 1200
 		$this->set( 'TKT_deleted', $deleted );
1201 1201
 	}
1202 1202
 
1203 1203
 
1204 1204
 
1205
-    /**
1206
-     * Gets parent
1207
-     *
1208
-     * @return int
1209
-     * @throws \EE_Error
1210
-     */
1205
+	/**
1206
+	 * Gets parent
1207
+	 *
1208
+	 * @return int
1209
+	 * @throws \EE_Error
1210
+	 */
1211 1211
 	public function parent_ID() {
1212 1212
 		return $this->get( 'TKT_parent' );
1213 1213
 	}
1214 1214
 
1215 1215
 
1216 1216
 
1217
-    /**
1218
-     * Sets parent
1219
-     *
1220
-     * @param int $parent
1221
-     * @return void
1222
-     * @throws \EE_Error
1223
-     */
1217
+	/**
1218
+	 * Sets parent
1219
+	 *
1220
+	 * @param int $parent
1221
+	 * @return void
1222
+	 * @throws \EE_Error
1223
+	 */
1224 1224
 	public function set_parent_ID( $parent ) {
1225 1225
 		$this->set( 'TKT_parent', $parent );
1226 1226
 	}
1227 1227
 
1228 1228
 
1229 1229
 
1230
-    /**
1231
-     * Gets a string which is handy for showing in gateways etc that describes the ticket.
1232
-     *
1233
-     * @return string
1234
-     * @throws \EE_Error
1235
-     */
1230
+	/**
1231
+	 * Gets a string which is handy for showing in gateways etc that describes the ticket.
1232
+	 *
1233
+	 * @return string
1234
+	 * @throws \EE_Error
1235
+	 */
1236 1236
 	public function name_and_info() {
1237 1237
 		$times = array();
1238 1238
 		foreach ( $this->datetimes() as $datetime ) {
@@ -1243,67 +1243,67 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 
1245 1245
 
1246
-    /**
1247
-     * Gets name
1248
-     *
1249
-     * @return string
1250
-     * @throws \EE_Error
1251
-     */
1246
+	/**
1247
+	 * Gets name
1248
+	 *
1249
+	 * @return string
1250
+	 * @throws \EE_Error
1251
+	 */
1252 1252
 	public function name() {
1253 1253
 		return $this->get( 'TKT_name' );
1254 1254
 	}
1255 1255
 
1256 1256
 
1257 1257
 
1258
-    /**
1259
-     * Gets price
1260
-     *
1261
-     * @return float
1262
-     * @throws \EE_Error
1263
-     */
1258
+	/**
1259
+	 * Gets price
1260
+	 *
1261
+	 * @return float
1262
+	 * @throws \EE_Error
1263
+	 */
1264 1264
 	public function price() {
1265 1265
 		return $this->get( 'TKT_price' );
1266 1266
 	}
1267 1267
 
1268 1268
 
1269 1269
 
1270
-    /**
1271
-     * Gets all the registrations for this ticket
1272
-     *
1273
-     * @param array $query_params like EEM_Base::get_all's
1274
-     * @return EE_Registration[]|EE_Base_Class[]
1275
-     * @throws \EE_Error
1276
-     */
1270
+	/**
1271
+	 * Gets all the registrations for this ticket
1272
+	 *
1273
+	 * @param array $query_params like EEM_Base::get_all's
1274
+	 * @return EE_Registration[]|EE_Base_Class[]
1275
+	 * @throws \EE_Error
1276
+	 */
1277 1277
 	public function registrations( $query_params = array() ) {
1278 1278
 		return $this->get_many_related( 'Registration', $query_params );
1279 1279
 	}
1280 1280
 
1281 1281
 
1282 1282
 
1283
-    /**
1284
-     * Updates the TKT_sold attribute (and saves) based on the number of APPROVED registrations for this ticket.
1285
-     * into account
1286
-     *
1287
-     * @return int
1288
-     * @throws \EE_Error
1289
-     */
1283
+	/**
1284
+	 * Updates the TKT_sold attribute (and saves) based on the number of APPROVED registrations for this ticket.
1285
+	 * into account
1286
+	 *
1287
+	 * @return int
1288
+	 * @throws \EE_Error
1289
+	 */
1290 1290
 	public function update_tickets_sold() {
1291
-        $count_regs_for_this_ticket = $this->count_registrations(
1292
-            array(
1293
-                array(
1294
-                    'STS_ID'      => EEM_Registration::status_id_approved,
1295
-                    'REG_deleted' => 0,
1296
-                ),
1297
-            )
1298
-        );
1299
-        $sold = $this->sold();
1300
-        if ($count_regs_for_this_ticket > $sold) {
1301
-            $this->increase_sold($count_regs_for_this_ticket - $sold);
1302
-            $this->save();
1303
-        } else if ($count_regs_for_this_ticket < $sold) {
1304
-            $this->decrease_sold($count_regs_for_this_ticket - $sold);
1305
-            $this->save();
1306
-        }
1291
+		$count_regs_for_this_ticket = $this->count_registrations(
1292
+			array(
1293
+				array(
1294
+					'STS_ID'      => EEM_Registration::status_id_approved,
1295
+					'REG_deleted' => 0,
1296
+				),
1297
+			)
1298
+		);
1299
+		$sold = $this->sold();
1300
+		if ($count_regs_for_this_ticket > $sold) {
1301
+			$this->increase_sold($count_regs_for_this_ticket - $sold);
1302
+			$this->save();
1303
+		} else if ($count_regs_for_this_ticket < $sold) {
1304
+			$this->decrease_sold($count_regs_for_this_ticket - $sold);
1305
+			$this->save();
1306
+		}
1307 1307
 		return $count_regs_for_this_ticket;
1308 1308
 	}
1309 1309
 
@@ -1331,21 +1331,21 @@  discard block
 block discarded – undo
1331 1331
 
1332 1332
 
1333 1333
 
1334
-    /**
1335
-     * Implementation of the EEI_Event_Relation interface method
1336
-     *
1337
-     * @see EEI_Event_Relation for comments
1338
-     * @return EE_Event
1339
-     * @throws \EE_Error
1340
-     * @throws UnexpectedEntityException
1341
-     */
1334
+	/**
1335
+	 * Implementation of the EEI_Event_Relation interface method
1336
+	 *
1337
+	 * @see EEI_Event_Relation for comments
1338
+	 * @return EE_Event
1339
+	 * @throws \EE_Error
1340
+	 * @throws UnexpectedEntityException
1341
+	 */
1342 1342
 	public function get_related_event() {
1343 1343
 		//get one datetime to use for getting the event
1344 1344
 		$datetime = $this->first_datetime();
1345 1345
 		if ( ! $datetime instanceof \EE_Datetime ) {
1346 1346
 			throw new UnexpectedEntityException(
1347 1347
 				$datetime,
1348
-                'EE_Datetime',
1348
+				'EE_Datetime',
1349 1349
 				sprintf(
1350 1350
 					__( 'The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'),
1351 1351
 					$this->name()
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 		if ( ! $event instanceof \EE_Event ) {
1357 1357
 			throw new UnexpectedEntityException(
1358 1358
 				$event,
1359
-                'EE_Event',
1359
+				'EE_Event',
1360 1360
 				sprintf(
1361 1361
 					__( 'The ticket (%s) is not associated with a valid event.', 'event_espresso'),
1362 1362
 					$this->name()
@@ -1368,14 +1368,14 @@  discard block
 block discarded – undo
1368 1368
 
1369 1369
 
1370 1370
 
1371
-    /**
1372
-     * Implementation of the EEI_Event_Relation interface method
1373
-     *
1374
-     * @see EEI_Event_Relation for comments
1375
-     * @return string
1376
-     * @throws UnexpectedEntityException
1377
-     * @throws \EE_Error
1378
-     */
1371
+	/**
1372
+	 * Implementation of the EEI_Event_Relation interface method
1373
+	 *
1374
+	 * @see EEI_Event_Relation for comments
1375
+	 * @return string
1376
+	 * @throws UnexpectedEntityException
1377
+	 * @throws \EE_Error
1378
+	 */
1379 1379
 	public function get_event_name() {
1380 1380
 		$event = $this->get_related_event();
1381 1381
 		return $event instanceof EE_Event ? $event->name() : '';
@@ -1383,14 +1383,14 @@  discard block
 block discarded – undo
1383 1383
 
1384 1384
 
1385 1385
 
1386
-    /**
1387
-     * Implementation of the EEI_Event_Relation interface method
1388
-     *
1389
-     * @see EEI_Event_Relation for comments
1390
-     * @return int
1391
-     * @throws UnexpectedEntityException
1392
-     * @throws \EE_Error
1393
-     */
1386
+	/**
1387
+	 * Implementation of the EEI_Event_Relation interface method
1388
+	 *
1389
+	 * @see EEI_Event_Relation for comments
1390
+	 * @return int
1391
+	 * @throws UnexpectedEntityException
1392
+	 * @throws \EE_Error
1393
+	 */
1394 1394
 	public function get_event_ID() {
1395 1395
 		$event = $this->get_related_event();
1396 1396
 		return $event instanceof EE_Event ? $event->ID() : 0;
Please login to merge, or discard this patch.
Spacing   +203 added lines, -203 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php use EventEspresso\core\exceptions\UnexpectedEntityException;
2 2
 
3
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
4
-	exit( 'No direct script access allowed' );
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4
+	exit('No direct script access allowed');
5 5
 }
6 6
 /**
7 7
  * Event Espresso
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      * @return EE_Ticket
71 71
      * @throws \EE_Error
72 72
      */
73
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
74
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
75
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
73
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
74
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
75
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
76 76
 	}
77 77
 
78 78
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
      * @return EE_Ticket
85 85
      * @throws \EE_Error
86 86
      */
87
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
88
-		return new self( $props_n_values, TRUE, $timezone );
87
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
88
+		return new self($props_n_values, TRUE, $timezone);
89 89
 	}
90 90
 
91 91
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @throws \EE_Error
96 96
      */
97 97
 	public function parent() {
98
-		return $this->get( 'TKT_parent' );
98
+		return $this->get('TKT_parent');
99 99
 	}
100 100
 
101 101
 
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
      * @return boolean
108 108
      * @throws \EE_Error
109 109
      */
110
-	public function available( $DTT_ID = 0 ) {
110
+	public function available($DTT_ID = 0) {
111 111
 		// are we checking availability for a particular datetime ?
112
-		if ( $DTT_ID ) {
112
+		if ($DTT_ID) {
113 113
 			// get that datetime object
114
-			$datetime = $this->get_first_related( 'Datetime', array( array( 'DTT_ID' => $DTT_ID ) ) );
114
+			$datetime = $this->get_first_related('Datetime', array(array('DTT_ID' => $DTT_ID)));
115 115
 			// if  ticket sales for this datetime have exceeded the reg limit...
116
-			if ( $datetime instanceof EE_Datetime && $datetime->sold_out() ) {
116
+			if ($datetime instanceof EE_Datetime && $datetime->sold_out()) {
117 117
 				return FALSE;
118 118
 			}
119 119
 		}
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
      * @return mixed status int if the display string isn't requested
132 132
      * @throws \EE_Error
133 133
      */
134
-	public function ticket_status( $display = FALSE, $remaining = null ) {
135
-		$remaining = is_bool( $remaining ) ? $remaining : $this->is_remaining();
136
-		if ( ! $remaining ) {
137
-			return $display ? EEH_Template::pretty_status( EE_Ticket::sold_out, FALSE, 'sentence' ) : EE_Ticket::sold_out;
134
+	public function ticket_status($display = FALSE, $remaining = null) {
135
+		$remaining = is_bool($remaining) ? $remaining : $this->is_remaining();
136
+		if ( ! $remaining) {
137
+			return $display ? EEH_Template::pretty_status(EE_Ticket::sold_out, FALSE, 'sentence') : EE_Ticket::sold_out;
138 138
 		}
139
-		if ( $this->get( 'TKT_deleted' ) ) {
140
-			return $display ? EEH_Template::pretty_status( EE_Ticket::archived, FALSE, 'sentence' ) : EE_Ticket::archived;
139
+		if ($this->get('TKT_deleted')) {
140
+			return $display ? EEH_Template::pretty_status(EE_Ticket::archived, FALSE, 'sentence') : EE_Ticket::archived;
141 141
 		}
142
-		if ( $this->is_expired() ) {
143
-			return $display ? EEH_Template::pretty_status( EE_Ticket::expired, FALSE, 'sentence' ) : EE_Ticket::expired;
142
+		if ($this->is_expired()) {
143
+			return $display ? EEH_Template::pretty_status(EE_Ticket::expired, FALSE, 'sentence') : EE_Ticket::expired;
144 144
 		}
145
-		if ( $this->is_pending() ) {
146
-			return $display ? EEH_Template::pretty_status( EE_Ticket::pending, FALSE, 'sentence' ) : EE_Ticket::pending;
145
+		if ($this->is_pending()) {
146
+			return $display ? EEH_Template::pretty_status(EE_Ticket::pending, FALSE, 'sentence') : EE_Ticket::pending;
147 147
 		}
148
-		if ( $this->is_on_sale() ) {
149
-			return $display ? EEH_Template::pretty_status( EE_Ticket::onsale, FALSE, 'sentence' ) : EE_Ticket::onsale;
148
+		if ($this->is_on_sale()) {
149
+			return $display ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : EE_Ticket::onsale;
150 150
 		}
151 151
 		return '';
152 152
 	}
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
      * @return boolean         true = tickets remaining, false not.
162 162
      * @throws \EE_Error
163 163
      */
164
-	public function is_remaining( $DTT_ID = 0 ) {
165
-		$num_remaining = $this->remaining( $DTT_ID );
166
-		if ( $num_remaining === 0 ) {
164
+	public function is_remaining($DTT_ID = 0) {
165
+		$num_remaining = $this->remaining($DTT_ID);
166
+		if ($num_remaining === 0) {
167 167
 			return FALSE;
168 168
 		}
169
-		if ( $num_remaining > 0 && $num_remaining < $this->min() ) {
169
+		if ($num_remaining > 0 && $num_remaining < $this->min()) {
170 170
 			return FALSE;
171 171
 		}
172 172
 		return TRUE;
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
      * @return int
183 183
      * @throws \EE_Error
184 184
      */
185
-	public function remaining( $DTT_ID = 0 ) {
186
-		return $this->real_quantity_on_ticket('saleable', $DTT_ID );
185
+	public function remaining($DTT_ID = 0) {
186
+		return $this->real_quantity_on_ticket('saleable', $DTT_ID);
187 187
 	}
188 188
 
189 189
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      * @throws \EE_Error
196 196
      */
197 197
 	public function min() {
198
-		return $this->get( 'TKT_min' );
198
+		return $this->get('TKT_min');
199 199
 	}
200 200
 
201 201
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      * @throws \EE_Error
208 208
      */
209 209
 	public function is_expired() {
210
-		return ( $this->get_raw( 'TKT_end_date' ) < time() );
210
+		return ($this->get_raw('TKT_end_date') < time());
211 211
 	}
212 212
 
213 213
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      * @throws \EE_Error
220 220
      */
221 221
 	public function is_pending() {
222
-		return ( $this->get_raw( 'TKT_start_date' ) > time() );
222
+		return ($this->get_raw('TKT_start_date') > time());
223 223
 	}
224 224
 
225 225
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      * @throws \EE_Error
232 232
      */
233 233
 	public function is_on_sale() {
234
-		return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() );
234
+		return ($this->get_raw('TKT_start_date') < time() && $this->get_raw('TKT_end_date') > time());
235 235
 	}
236 236
 
237 237
 
@@ -244,11 +244,11 @@  discard block
 block discarded – undo
244 244
      * @return string
245 245
      * @throws \EE_Error
246 246
      */
247
-	public function date_range( $dt_frmt = '', $conjunction = ' - ' ) {
248
-		$first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date( $dt_frmt ) : '';
249
-		$last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date( $dt_frmt ) : '';
247
+	public function date_range($dt_frmt = '', $conjunction = ' - ') {
248
+		$first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date($dt_frmt) : '';
249
+		$last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date($dt_frmt) : '';
250 250
 
251
-		return $first_date && $last_date ? $first_date . $conjunction  . $last_date : '';
251
+		return $first_date && $last_date ? $first_date.$conjunction.$last_date : '';
252 252
 	}
253 253
 
254 254
 
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
      * @throws \EE_Error
261 261
      */
262 262
 	public function first_datetime() {
263
-		$datetimes = $this->datetimes( array( 'limit' => 1 ) );
264
-		return reset( $datetimes );
263
+		$datetimes = $this->datetimes(array('limit' => 1));
264
+		return reset($datetimes);
265 265
 	}
266 266
 
267 267
 
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
      * @return EE_Datetime[]|EE_Base_Class[]
275 275
      * @throws \EE_Error
276 276
      */
277
-	public function datetimes( $query_params = array() ) {
278
-		if ( ! isset( $query_params[ 'order_by' ] ) ) {
279
-			$query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC';
277
+	public function datetimes($query_params = array()) {
278
+		if ( ! isset($query_params['order_by'])) {
279
+			$query_params['order_by']['DTT_order'] = 'ASC';
280 280
 		}
281
-		return $this->get_many_related( 'Datetime', $query_params );
281
+		return $this->get_many_related('Datetime', $query_params);
282 282
 	}
283 283
 
284 284
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
      * @throws \EE_Error
291 291
      */
292 292
 	public function last_datetime() {
293
-		$datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) );
294
-		return end( $datetimes );
293
+		$datetimes = $this->datetimes(array('limit' => 1, 'order_by' => array('DTT_EVT_start' => 'DESC')));
294
+		return end($datetimes);
295 295
 	}
296 296
 
297 297
 
@@ -309,22 +309,22 @@  discard block
 block discarded – undo
309 309
      * @return mixed (array|int)          how many tickets have sold
310 310
      * @throws \EE_Error
311 311
      */
312
-	public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) {
312
+	public function tickets_sold($what = 'ticket', $dtt_id = NULL) {
313 313
 		$total = 0;
314 314
 		$tickets_sold = $this->_all_tickets_sold();
315
-		switch ( $what ) {
315
+		switch ($what) {
316 316
 			case 'ticket' :
317
-				return $tickets_sold[ 'ticket' ];
317
+				return $tickets_sold['ticket'];
318 318
 				break;
319 319
 			case 'datetime' :
320
-				if ( empty( $tickets_sold[ 'datetime' ] ) ) {
320
+				if (empty($tickets_sold['datetime'])) {
321 321
 					return $total;
322 322
 				}
323
-				if ( ! empty( $dtt_id ) && ! isset( $tickets_sold[ 'datetime' ][ $dtt_id ] ) ) {
324
-					EE_Error::add_error( __( 'You\'ve requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included.  Are you SURE that is a datetime related to this ticket?', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
323
+				if ( ! empty($dtt_id) && ! isset($tickets_sold['datetime'][$dtt_id])) {
324
+					EE_Error::add_error(__('You\'ve requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included.  Are you SURE that is a datetime related to this ticket?', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
325 325
 					return $total;
326 326
 				}
327
-				return empty( $dtt_id ) ? $tickets_sold[ 'datetime' ] : $tickets_sold[ 'datetime' ][ $dtt_id ];
327
+				return empty($dtt_id) ? $tickets_sold['datetime'] : $tickets_sold['datetime'][$dtt_id];
328 328
 				break;
329 329
 			default:
330 330
 				return $total;
@@ -340,15 +340,15 @@  discard block
 block discarded – undo
340 340
      * @throws \EE_Error
341 341
      */
342 342
 	protected function _all_tickets_sold() {
343
-		$datetimes = $this->get_many_related( 'Datetime' );
343
+		$datetimes = $this->get_many_related('Datetime');
344 344
 		$tickets_sold = array();
345
-		if ( ! empty( $datetimes ) ) {
346
-			foreach ( $datetimes as $datetime ) {
347
-				$tickets_sold[ 'datetime' ][ $datetime->ID() ] = $datetime->get( 'DTT_sold' );
345
+		if ( ! empty($datetimes)) {
346
+			foreach ($datetimes as $datetime) {
347
+				$tickets_sold['datetime'][$datetime->ID()] = $datetime->get('DTT_sold');
348 348
 			}
349 349
 		}
350 350
 		//Tickets sold
351
-		$tickets_sold[ 'ticket' ] = $this->sold();
351
+		$tickets_sold['ticket'] = $this->sold();
352 352
 		return $tickets_sold;
353 353
 	}
354 354
 
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
      * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[]
362 362
      * @throws \EE_Error
363 363
      */
364
-	public function base_price( $return_array = FALSE ) {
365
-		$_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price );
364
+	public function base_price($return_array = FALSE) {
365
+		$_where = array('Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price);
366 366
 		return $return_array
367
-            ? $this->get_many_related( 'Price', array( $_where ) )
368
-            : $this->get_first_related( 'Price', array( $_where ) );
367
+            ? $this->get_many_related('Price', array($_where))
368
+            : $this->get_first_related('Price', array($_where));
369 369
 	}
370 370
 
371 371
 
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
      * @throws \EE_Error
379 379
      */
380 380
 	public function price_modifiers() {
381
-		$query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) );
382
-		return $this->prices( $query_params );
381
+		$query_params = array(0 => array('Price_Type.PBT_ID' => array('NOT IN', array(EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax))));
382
+		return $this->prices($query_params);
383 383
 	}
384 384
 
385 385
 
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
      * @return EE_Price[]|EE_Base_Class[]
392 392
      * @throws \EE_Error
393 393
      */
394
-	public function prices( $query_params = array() ) {
395
-		return $this->get_many_related( 'Price', $query_params );
394
+	public function prices($query_params = array()) {
395
+		return $this->get_many_related('Price', $query_params);
396 396
 	}
397 397
 
398 398
 
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
      * @return EE_Datetime_Ticket|EE_Base_Class[]
405 405
      * @throws \EE_Error
406 406
      */
407
-	public function datetime_tickets( $query_params = array() ) {
408
-		return $this->get_many_related( 'Datetime_Ticket', $query_params );
407
+	public function datetime_tickets($query_params = array()) {
408
+		return $this->get_many_related('Datetime_Ticket', $query_params);
409 409
 	}
410 410
 
411 411
 
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
      * @return EE_Datetime[]
419 419
      * @throws \EE_Error
420 420
      */
421
-	public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) {
422
-		return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted );
421
+	public function datetimes_ordered($show_expired = TRUE, $show_deleted = FALSE) {
422
+		return EEM_Datetime::instance($this->_timezone)->get_datetimes_for_ticket_ordered_by_DTT_order($this->ID(), $show_expired, $show_deleted);
423 423
 	}
424 424
 
425 425
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
      * @throws \EE_Error
432 432
      */
433 433
 	public function ID() {
434
-		return $this->get( 'TKT_ID' );
434
+		return $this->get('TKT_ID');
435 435
 	}
436 436
 
437 437
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      * @throws \EE_Error
457 457
      */
458 458
 	public function template() {
459
-		return $this->get_first_related( 'Ticket_Template' );
459
+		return $this->get_first_related('Ticket_Template');
460 460
 	}
461 461
 
462 462
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
      * @throws \EE_Error
479 479
      */
480 480
 	public function ticket_price() {
481
-		return $this->get( 'TKT_price' );
481
+		return $this->get('TKT_price');
482 482
 	}
483 483
 
484 484
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
      * @throws \EE_Error
489 489
      */
490 490
 	public function pretty_price() {
491
-		return $this->get_pretty( 'TKT_price' );
491
+		return $this->get_pretty('TKT_price');
492 492
 	}
493 493
 
494 494
 
@@ -510,8 +510,8 @@  discard block
 block discarded – undo
510 510
      * @return float
511 511
      * @throws \EE_Error
512 512
      */
513
-	public function get_ticket_total_with_taxes( $no_cache = FALSE ) {
514
-		if ($this->_ticket_total_with_taxes === null || $no_cache ) {
513
+	public function get_ticket_total_with_taxes($no_cache = FALSE) {
514
+		if ($this->_ticket_total_with_taxes === null || $no_cache) {
515 515
 			$this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin();
516 516
 		}
517 517
 		return (float) $this->_ticket_total_with_taxes;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 
521 521
 
522 522
 	public function ensure_TKT_Price_correct() {
523
-		$this->set( 'TKT_price', EE_Taxes::get_subtotal_for_admin( $this ) );
523
+		$this->set('TKT_price', EE_Taxes::get_subtotal_for_admin($this));
524 524
 		$this->save();
525 525
 	}
526 526
 
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
      * @throws \EE_Error
532 532
      */
533 533
 	public function get_ticket_subtotal() {
534
-		return EE_Taxes::get_subtotal_for_admin( $this );
534
+		return EE_Taxes::get_subtotal_for_admin($this);
535 535
 	}
536 536
 
537 537
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
      * @throws \EE_Error
544 544
      */
545 545
 	public function get_ticket_taxes_total_for_admin() {
546
-		return EE_Taxes::get_total_taxes_for_admin( $this );
546
+		return EE_Taxes::get_total_taxes_for_admin($this);
547 547
 	}
548 548
 
549 549
 
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
      * @param string $name
555 555
      * @throws \EE_Error
556 556
      */
557
-	public function set_name( $name ) {
558
-		$this->set( 'TKT_name', $name );
557
+	public function set_name($name) {
558
+		$this->set('TKT_name', $name);
559 559
 	}
560 560
 
561 561
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
      * @throws \EE_Error
568 568
      */
569 569
 	public function description() {
570
-		return $this->get( 'TKT_description' );
570
+		return $this->get('TKT_description');
571 571
 	}
572 572
 
573 573
 
@@ -578,8 +578,8 @@  discard block
 block discarded – undo
578 578
      * @param string $description
579 579
      * @throws \EE_Error
580 580
      */
581
-	public function set_description( $description ) {
582
-		$this->set( 'TKT_description', $description );
581
+	public function set_description($description) {
582
+		$this->set('TKT_description', $description);
583 583
 	}
584 584
 
585 585
 
@@ -592,8 +592,8 @@  discard block
 block discarded – undo
592 592
      * @return string
593 593
      * @throws \EE_Error
594 594
      */
595
-	public function start_date( $dt_frmt = '', $tm_frmt = '' ) {
596
-		return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt );
595
+	public function start_date($dt_frmt = '', $tm_frmt = '') {
596
+		return $this->_get_datetime('TKT_start_date', $dt_frmt, $tm_frmt);
597 597
 	}
598 598
 
599 599
 
@@ -605,8 +605,8 @@  discard block
 block discarded – undo
605 605
      * @return void
606 606
      * @throws \EE_Error
607 607
      */
608
-	public function set_start_date( $start_date ) {
609
-		$this->_set_date_time( 'B', $start_date, 'TKT_start_date' );
608
+	public function set_start_date($start_date) {
609
+		$this->_set_date_time('B', $start_date, 'TKT_start_date');
610 610
 	}
611 611
 
612 612
 
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
      * @return string
620 620
      * @throws \EE_Error
621 621
      */
622
-	public function end_date( $dt_frmt = '', $tm_frmt = '' ) {
623
-		return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt );
622
+	public function end_date($dt_frmt = '', $tm_frmt = '') {
623
+		return $this->_get_datetime('TKT_end_date', $dt_frmt, $tm_frmt);
624 624
 	}
625 625
 
626 626
 
@@ -632,8 +632,8 @@  discard block
 block discarded – undo
632 632
      * @return void
633 633
      * @throws \EE_Error
634 634
      */
635
-	public function set_end_date( $end_date ) {
636
-		$this->_set_date_time( 'B', $end_date, 'TKT_end_date' );
635
+	public function set_end_date($end_date) {
636
+		$this->_set_date_time('B', $end_date, 'TKT_end_date');
637 637
 	}
638 638
 
639 639
 
@@ -645,8 +645,8 @@  discard block
 block discarded – undo
645 645
      * @param string $time a string representation of the sell until time (ex 9am or 7:30pm)
646 646
      * @throws \EE_Error
647 647
      */
648
-	public function set_end_time( $time ) {
649
-		$this->_set_time_for( $time, 'TKT_end_date' );
648
+	public function set_end_time($time) {
649
+		$this->_set_time_for($time, 'TKT_end_date');
650 650
 	}
651 651
 
652 652
 
@@ -658,8 +658,8 @@  discard block
 block discarded – undo
658 658
      * @return void
659 659
      * @throws \EE_Error
660 660
      */
661
-	public function set_min( $min ) {
662
-		$this->set( 'TKT_min', $min );
661
+	public function set_min($min) {
662
+		$this->set('TKT_min', $min);
663 663
 	}
664 664
 
665 665
 
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
      * @throws \EE_Error
672 672
      */
673 673
 	public function max() {
674
-		return $this->get( 'TKT_max' );
674
+		return $this->get('TKT_max');
675 675
 	}
676 676
 
677 677
 
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
      * @return void
684 684
      * @throws \EE_Error
685 685
      */
686
-	public function set_max( $max ) {
687
-		$this->set( 'TKT_max', $max );
686
+	public function set_max($max) {
687
+		$this->set('TKT_max', $max);
688 688
 	}
689 689
 
690 690
 
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
      * @return void
697 697
      * @throws \EE_Error
698 698
      */
699
-	public function set_price( $price ) {
700
-		$this->set( 'TKT_price', $price );
699
+	public function set_price($price) {
700
+		$this->set('TKT_price', $price);
701 701
 	}
702 702
 
703 703
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
      * @throws \EE_Error
710 710
      */
711 711
 	public function sold() {
712
-		return $this->get_raw( 'TKT_sold' );
712
+		return $this->get_raw('TKT_sold');
713 713
 	}
714 714
 
715 715
 
@@ -721,10 +721,10 @@  discard block
 block discarded – undo
721 721
      * @return void
722 722
      * @throws \EE_Error
723 723
      */
724
-	public function set_sold( $sold ) {
724
+	public function set_sold($sold) {
725 725
 		// sold can not go below zero
726
-		$sold = max( 0, $sold );
727
-		$this->set( 'TKT_sold', $sold );
726
+		$sold = max(0, $sold);
727
+		$this->set('TKT_sold', $sold);
728 728
 	}
729 729
 
730 730
 
@@ -736,13 +736,13 @@  discard block
 block discarded – undo
736 736
      * @return void
737 737
      * @throws \EE_Error
738 738
      */
739
-	public function increase_sold( $qty = 1 ) {
739
+	public function increase_sold($qty = 1) {
740 740
 		$sold = $this->sold() + $qty;
741 741
 		// remove ticket reservation, but don't adjust datetime reservations,  because that will happen
742 742
 		// via \EE_Datetime::increase_sold() when \EE_Ticket::_increase_sold_for_datetimes() is called
743
-		$this->decrease_reserved( $qty, false );
744
-		$this->_increase_sold_for_datetimes( $qty );
745
-		$this->set_sold( $sold );
743
+		$this->decrease_reserved($qty, false);
744
+		$this->_increase_sold_for_datetimes($qty);
745
+		$this->set_sold($sold);
746 746
 	}
747 747
 
748 748
 
@@ -754,12 +754,12 @@  discard block
 block discarded – undo
754 754
      * @return void
755 755
      * @throws \EE_Error
756 756
      */
757
-	protected function _increase_sold_for_datetimes( $qty = 1 ) {
757
+	protected function _increase_sold_for_datetimes($qty = 1) {
758 758
 		$datetimes = $this->datetimes();
759
-		if ( is_array( $datetimes ) ) {
760
-			foreach ( $datetimes as $datetime ) {
761
-				if ( $datetime instanceof EE_Datetime ) {
762
-					$datetime->increase_sold( $qty );
759
+		if (is_array($datetimes)) {
760
+			foreach ($datetimes as $datetime) {
761
+				if ($datetime instanceof EE_Datetime) {
762
+					$datetime->increase_sold($qty);
763 763
 					$datetime->save();
764 764
 				}
765 765
 			}
@@ -775,10 +775,10 @@  discard block
 block discarded – undo
775 775
      * @return void
776 776
      * @throws \EE_Error
777 777
      */
778
-	public function decrease_sold( $qty = 1 ) {
778
+	public function decrease_sold($qty = 1) {
779 779
 		$sold = $this->sold() - $qty;
780
-		$this->_decrease_sold_for_datetimes( $qty );
781
-		$this->set_sold( $sold );
780
+		$this->_decrease_sold_for_datetimes($qty);
781
+		$this->set_sold($sold);
782 782
 	}
783 783
 
784 784
 
@@ -790,12 +790,12 @@  discard block
 block discarded – undo
790 790
      * @return void
791 791
      * @throws \EE_Error
792 792
      */
793
-	protected function _decrease_sold_for_datetimes( $qty = 1 ) {
793
+	protected function _decrease_sold_for_datetimes($qty = 1) {
794 794
 		$datetimes = $this->datetimes();
795
-		if ( is_array( $datetimes ) ) {
796
-			foreach ( $datetimes as $datetime ) {
797
-				if ( $datetime instanceof EE_Datetime ) {
798
-					$datetime->decrease_sold( $qty );
795
+		if (is_array($datetimes)) {
796
+			foreach ($datetimes as $datetime) {
797
+				if ($datetime instanceof EE_Datetime) {
798
+					$datetime->decrease_sold($qty);
799 799
 					$datetime->save();
800 800
 				}
801 801
 			}
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
      * @throws \EE_Error
812 812
      */
813 813
 	public function reserved() {
814
-		return $this->get_raw( 'TKT_reserved' );
814
+		return $this->get_raw('TKT_reserved');
815 815
 	}
816 816
 
817 817
 
@@ -823,10 +823,10 @@  discard block
 block discarded – undo
823 823
      * @return void
824 824
      * @throws \EE_Error
825 825
      */
826
-	public function set_reserved( $reserved ) {
826
+	public function set_reserved($reserved) {
827 827
 		// reserved can not go below zero
828
-		$reserved = max( 0, (int) $reserved );
829
-		$this->set( 'TKT_reserved', $reserved );
828
+		$reserved = max(0, (int) $reserved);
829
+		$this->set('TKT_reserved', $reserved);
830 830
 	}
831 831
 
832 832
 
@@ -838,11 +838,11 @@  discard block
 block discarded – undo
838 838
      * @return void
839 839
      * @throws \EE_Error
840 840
      */
841
-	public function increase_reserved( $qty = 1 ) {
842
-		$qty = absint( $qty );
841
+	public function increase_reserved($qty = 1) {
842
+		$qty = absint($qty);
843 843
 		$reserved = $this->reserved() + $qty;
844
-		$this->_increase_reserved_for_datetimes( $qty );
845
-		$this->set_reserved( $reserved );
844
+		$this->_increase_reserved_for_datetimes($qty);
845
+		$this->set_reserved($reserved);
846 846
 	}
847 847
 
848 848
 
@@ -854,12 +854,12 @@  discard block
 block discarded – undo
854 854
      * @return void
855 855
      * @throws \EE_Error
856 856
      */
857
-	protected function _increase_reserved_for_datetimes( $qty = 1 ) {
857
+	protected function _increase_reserved_for_datetimes($qty = 1) {
858 858
 		$datetimes = $this->datetimes();
859
-		if ( is_array( $datetimes ) ) {
860
-			foreach ( $datetimes as $datetime ) {
861
-				if ( $datetime instanceof EE_Datetime ) {
862
-					$datetime->increase_reserved( $qty );
859
+		if (is_array($datetimes)) {
860
+			foreach ($datetimes as $datetime) {
861
+				if ($datetime instanceof EE_Datetime) {
862
+					$datetime->increase_reserved($qty);
863 863
 					$datetime->save();
864 864
 				}
865 865
 			}
@@ -876,12 +876,12 @@  discard block
 block discarded – undo
876 876
      * @return void
877 877
      * @throws \EE_Error
878 878
      */
879
-	public function decrease_reserved( $qty = 1, $adjust_datetimes = true ) {
880
-		$reserved = $this->reserved() - absint( $qty );
881
-		if ( $adjust_datetimes ) {
882
-			$this->_decrease_reserved_for_datetimes( $qty );
879
+	public function decrease_reserved($qty = 1, $adjust_datetimes = true) {
880
+		$reserved = $this->reserved() - absint($qty);
881
+		if ($adjust_datetimes) {
882
+			$this->_decrease_reserved_for_datetimes($qty);
883 883
 		}
884
-		$this->set_reserved( $reserved );
884
+		$this->set_reserved($reserved);
885 885
 	}
886 886
 
887 887
 
@@ -893,12 +893,12 @@  discard block
 block discarded – undo
893 893
      * @return void
894 894
      * @throws \EE_Error
895 895
      */
896
-	protected function _decrease_reserved_for_datetimes( $qty = 1 ) {
896
+	protected function _decrease_reserved_for_datetimes($qty = 1) {
897 897
 		$datetimes = $this->datetimes();
898
-		if ( is_array( $datetimes ) ) {
899
-			foreach ( $datetimes as $datetime ) {
900
-				if ( $datetime instanceof EE_Datetime ) {
901
-					$datetime->decrease_reserved( $qty );
898
+		if (is_array($datetimes)) {
899
+			foreach ($datetimes as $datetime) {
900
+				if ($datetime instanceof EE_Datetime) {
901
+					$datetime->decrease_reserved($qty);
902 902
 					$datetime->save();
903 903
 				}
904 904
 			}
@@ -919,14 +919,14 @@  discard block
 block discarded – undo
919 919
      * @return int
920 920
      * @throws \EE_Error
921 921
      */
922
-	public function qty( $context = '' ) {
923
-		switch ( $context ) {
922
+	public function qty($context = '') {
923
+		switch ($context) {
924 924
 			case 'reg_limit' :
925 925
 				return $this->real_quantity_on_ticket();
926 926
 			case 'saleable' :
927
-				return $this->real_quantity_on_ticket( 'saleable' );
927
+				return $this->real_quantity_on_ticket('saleable');
928 928
 			default:
929
-				return $this->get_raw( 'TKT_qty' );
929
+				return $this->get_raw('TKT_qty');
930 930
 		}
931 931
 	}
932 932
 
@@ -945,15 +945,15 @@  discard block
 block discarded – undo
945 945
      * @return int
946 946
      * @throws \EE_Error
947 947
      */
948
-	public function real_quantity_on_ticket( $context = 'reg_limit', $DTT_ID = 0 ) {
949
-		$raw = $this->get_raw( 'TKT_qty' );
948
+	public function real_quantity_on_ticket($context = 'reg_limit', $DTT_ID = 0) {
949
+		$raw = $this->get_raw('TKT_qty');
950 950
 		// return immediately if it's zero
951
-		if ( $raw === 0 ) {
951
+		if ($raw === 0) {
952 952
 			return $raw;
953 953
 		}
954 954
 		//echo "\n\n<br />Ticket: " . $this->name() . '<br />';
955 955
 		// ensure qty doesn't exceed raw value for THIS ticket
956
-		$qty = min( EE_INF, $raw );
956
+		$qty = min(EE_INF, $raw);
957 957
 		//echo "\n . qty: " . $qty . '<br />';
958 958
 		// calculate this ticket's total sales and reservations
959 959
 		$sold_and_reserved_for_this_ticket = $this->sold() + $this->reserved();
@@ -962,23 +962,23 @@  discard block
 block discarded – undo
962 962
 		//echo "\n . sold_and_reserved_for_this_ticket: " . $sold_and_reserved_for_this_ticket . '<br />';
963 963
 		// first we need to calculate the maximum number of tickets available for the datetime
964 964
 		// do we want data for one datetime or all of them ?
965
-		$query_params = $DTT_ID ? array( array( 'DTT_ID' => $DTT_ID ) ) : array();
966
-		$datetimes = $this->datetimes( $query_params );
967
-		if ( is_array( $datetimes ) && ! empty( $datetimes ) ) {
968
-			foreach ( $datetimes as $datetime ) {
969
-				if ( $datetime instanceof EE_Datetime ) {
965
+		$query_params = $DTT_ID ? array(array('DTT_ID' => $DTT_ID)) : array();
966
+		$datetimes = $this->datetimes($query_params);
967
+		if (is_array($datetimes) && ! empty($datetimes)) {
968
+			foreach ($datetimes as $datetime) {
969
+				if ($datetime instanceof EE_Datetime) {
970 970
 					$datetime->refresh_from_db();
971 971
 					//echo "\n . . datetime name: " . $datetime->name() . '<br />';
972 972
 					//echo "\n . . datetime ID: " . $datetime->ID() . '<br />';
973 973
 					// initialize with no restrictions for each datetime
974 974
 					// but adjust datetime qty based on datetime reg limit
975
-					$datetime_qty = min( EE_INF, $datetime->reg_limit() );
975
+					$datetime_qty = min(EE_INF, $datetime->reg_limit());
976 976
 					//echo "\n . . . datetime reg_limit: " . $datetime->reg_limit() . '<br />';
977 977
 					//echo "\n . . . datetime_qty: " . $datetime_qty . '<br />';
978 978
 					// if we want the actual saleable amount, then we need to consider OTHER ticket sales
979 979
 					// and reservations for this datetime, that do NOT include sales and reservations
980 980
 					// for this ticket (so we add $this->sold() and $this->reserved() back in)
981
-					if ( $context === 'saleable' ) {
981
+					if ($context === 'saleable') {
982 982
 						$datetime_qty = max(
983 983
 							$datetime_qty - $datetime->sold_and_reserved() + $sold_and_reserved_for_this_ticket,
984 984
 							0
@@ -990,16 +990,16 @@  discard block
 block discarded – undo
990 990
 						$datetime_qty = ! $datetime->sold_out() ? $datetime_qty : 0;
991 991
 						//echo "\n . . . datetime_qty: " . $datetime_qty . '<br />';
992 992
 					}
993
-					$qty = min( $datetime_qty, $qty );
993
+					$qty = min($datetime_qty, $qty);
994 994
 					//echo "\n . . qty: " . $qty . '<br />';
995 995
 				}
996 996
 			}
997 997
 		}
998 998
 		// NOW that we know the  maximum number of tickets available for the datetime
999 999
 		// we can finally factor in the details for this specific ticket
1000
-		if ( $qty > 0 && $context === 'saleable' ) {
1000
+		if ($qty > 0 && $context === 'saleable') {
1001 1001
 			// and subtract the sales for THIS ticket
1002
-			$qty = max( $qty - $sold_and_reserved_for_this_ticket, 0 );
1002
+			$qty = max($qty - $sold_and_reserved_for_this_ticket, 0);
1003 1003
 			//echo "\n . qty: " . $qty . '<br />';
1004 1004
 		}
1005 1005
 		//echo "\nFINAL QTY: " . $qty . "<br /><br />";
@@ -1015,14 +1015,14 @@  discard block
 block discarded – undo
1015 1015
 	 * @return void
1016 1016
 	 * @throws \EE_Error
1017 1017
 	 */
1018
-	public function set_qty( $qty ) {
1018
+	public function set_qty($qty) {
1019 1019
 		$datetimes = $this->datetimes();
1020
-		foreach ( $datetimes as $datetime ) {
1021
-			if ( $datetime instanceof EE_Datetime ) {
1022
-				$qty = min( $qty, $datetime->reg_limit() );
1020
+		foreach ($datetimes as $datetime) {
1021
+			if ($datetime instanceof EE_Datetime) {
1022
+				$qty = min($qty, $datetime->reg_limit());
1023 1023
 			}
1024 1024
 		}
1025
-		$this->set( 'TKT_qty', $qty );
1025
+		$this->set('TKT_qty', $qty);
1026 1026
 	}
1027 1027
 
1028 1028
 
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
      * @throws \EE_Error
1035 1035
      */
1036 1036
 	public function uses() {
1037
-		return $this->get( 'TKT_uses' );
1037
+		return $this->get('TKT_uses');
1038 1038
 	}
1039 1039
 
1040 1040
 
@@ -1046,8 +1046,8 @@  discard block
 block discarded – undo
1046 1046
      * @return void
1047 1047
      * @throws \EE_Error
1048 1048
      */
1049
-	public function set_uses( $uses ) {
1050
-		$this->set( 'TKT_uses', $uses );
1049
+	public function set_uses($uses) {
1050
+		$this->set('TKT_uses', $uses);
1051 1051
 	}
1052 1052
 
1053 1053
 
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
      * @throws \EE_Error
1060 1060
      */
1061 1061
 	public function required() {
1062
-		return $this->get( 'TKT_required' );
1062
+		return $this->get('TKT_required');
1063 1063
 	}
1064 1064
 
1065 1065
 
@@ -1071,8 +1071,8 @@  discard block
 block discarded – undo
1071 1071
      * @return void
1072 1072
      * @throws \EE_Error
1073 1073
      */
1074
-	public function set_required( $required ) {
1075
-		$this->set( 'TKT_required', $required );
1074
+	public function set_required($required) {
1075
+		$this->set('TKT_required', $required);
1076 1076
 	}
1077 1077
 
1078 1078
 
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
      * @throws \EE_Error
1085 1085
      */
1086 1086
 	public function taxable() {
1087
-		return $this->get( 'TKT_taxable' );
1087
+		return $this->get('TKT_taxable');
1088 1088
 	}
1089 1089
 
1090 1090
 
@@ -1096,8 +1096,8 @@  discard block
 block discarded – undo
1096 1096
      * @return void
1097 1097
      * @throws \EE_Error
1098 1098
      */
1099
-	public function set_taxable( $taxable ) {
1100
-		$this->set( 'TKT_taxable', $taxable );
1099
+	public function set_taxable($taxable) {
1100
+		$this->set('TKT_taxable', $taxable);
1101 1101
 	}
1102 1102
 
1103 1103
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
      * @throws \EE_Error
1110 1110
      */
1111 1111
 	public function is_default() {
1112
-		return $this->get( 'TKT_is_default' );
1112
+		return $this->get('TKT_is_default');
1113 1113
 	}
1114 1114
 
1115 1115
 
@@ -1121,8 +1121,8 @@  discard block
 block discarded – undo
1121 1121
      * @return void
1122 1122
      * @throws \EE_Error
1123 1123
      */
1124
-	public function set_is_default( $is_default ) {
1125
-		$this->set( 'TKT_is_default', $is_default );
1124
+	public function set_is_default($is_default) {
1125
+		$this->set('TKT_is_default', $is_default);
1126 1126
 	}
1127 1127
 
1128 1128
 
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
      * @throws \EE_Error
1135 1135
      */
1136 1136
 	public function order() {
1137
-		return $this->get( 'TKT_order' );
1137
+		return $this->get('TKT_order');
1138 1138
 	}
1139 1139
 
1140 1140
 
@@ -1146,8 +1146,8 @@  discard block
 block discarded – undo
1146 1146
      * @return void
1147 1147
      * @throws \EE_Error
1148 1148
      */
1149
-	public function set_order( $order ) {
1150
-		$this->set( 'TKT_order', $order );
1149
+	public function set_order($order) {
1150
+		$this->set('TKT_order', $order);
1151 1151
 	}
1152 1152
 
1153 1153
 
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
      * @throws \EE_Error
1160 1160
      */
1161 1161
 	public function row() {
1162
-		return $this->get( 'TKT_row' );
1162
+		return $this->get('TKT_row');
1163 1163
 	}
1164 1164
 
1165 1165
 
@@ -1171,8 +1171,8 @@  discard block
 block discarded – undo
1171 1171
      * @return void
1172 1172
      * @throws \EE_Error
1173 1173
      */
1174
-	public function set_row( $row ) {
1175
-		$this->set( 'TKT_row', $row );
1174
+	public function set_row($row) {
1175
+		$this->set('TKT_row', $row);
1176 1176
 	}
1177 1177
 
1178 1178
 
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
      * @throws \EE_Error
1185 1185
      */
1186 1186
 	public function deleted() {
1187
-		return $this->get( 'TKT_deleted' );
1187
+		return $this->get('TKT_deleted');
1188 1188
 	}
1189 1189
 
1190 1190
 
@@ -1196,8 +1196,8 @@  discard block
 block discarded – undo
1196 1196
      * @return void
1197 1197
      * @throws \EE_Error
1198 1198
      */
1199
-	public function set_deleted( $deleted ) {
1200
-		$this->set( 'TKT_deleted', $deleted );
1199
+	public function set_deleted($deleted) {
1200
+		$this->set('TKT_deleted', $deleted);
1201 1201
 	}
1202 1202
 
1203 1203
 
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
      * @throws \EE_Error
1210 1210
      */
1211 1211
 	public function parent_ID() {
1212
-		return $this->get( 'TKT_parent' );
1212
+		return $this->get('TKT_parent');
1213 1213
 	}
1214 1214
 
1215 1215
 
@@ -1221,8 +1221,8 @@  discard block
 block discarded – undo
1221 1221
      * @return void
1222 1222
      * @throws \EE_Error
1223 1223
      */
1224
-	public function set_parent_ID( $parent ) {
1225
-		$this->set( 'TKT_parent', $parent );
1224
+	public function set_parent_ID($parent) {
1225
+		$this->set('TKT_parent', $parent);
1226 1226
 	}
1227 1227
 
1228 1228
 
@@ -1235,10 +1235,10 @@  discard block
 block discarded – undo
1235 1235
      */
1236 1236
 	public function name_and_info() {
1237 1237
 		$times = array();
1238
-		foreach ( $this->datetimes() as $datetime ) {
1238
+		foreach ($this->datetimes() as $datetime) {
1239 1239
 			$times[] = $datetime->start_date_and_time();
1240 1240
 		}
1241
-		return $this->name() . ' @ ' . implode( ', ', $times ) . ' for ' . $this->pretty_price();
1241
+		return $this->name().' @ '.implode(', ', $times).' for '.$this->pretty_price();
1242 1242
 	}
1243 1243
 
1244 1244
 
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
      * @throws \EE_Error
1251 1251
      */
1252 1252
 	public function name() {
1253
-		return $this->get( 'TKT_name' );
1253
+		return $this->get('TKT_name');
1254 1254
 	}
1255 1255
 
1256 1256
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
      * @throws \EE_Error
1263 1263
      */
1264 1264
 	public function price() {
1265
-		return $this->get( 'TKT_price' );
1265
+		return $this->get('TKT_price');
1266 1266
 	}
1267 1267
 
1268 1268
 
@@ -1274,8 +1274,8 @@  discard block
 block discarded – undo
1274 1274
      * @return EE_Registration[]|EE_Base_Class[]
1275 1275
      * @throws \EE_Error
1276 1276
      */
1277
-	public function registrations( $query_params = array() ) {
1278
-		return $this->get_many_related( 'Registration', $query_params );
1277
+	public function registrations($query_params = array()) {
1278
+		return $this->get_many_related('Registration', $query_params);
1279 1279
 	}
1280 1280
 
1281 1281
 
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 	 * @param array $query_params like EEM_Base::get_all's
1315 1315
 	 * @return int
1316 1316
 	 */
1317
-	public function count_registrations( $query_params = array() ) {
1317
+	public function count_registrations($query_params = array()) {
1318 1318
 		return $this->count_related('Registration', $query_params);
1319 1319
 	}
1320 1320
 
@@ -1342,23 +1342,23 @@  discard block
 block discarded – undo
1342 1342
 	public function get_related_event() {
1343 1343
 		//get one datetime to use for getting the event
1344 1344
 		$datetime = $this->first_datetime();
1345
-		if ( ! $datetime instanceof \EE_Datetime ) {
1345
+		if ( ! $datetime instanceof \EE_Datetime) {
1346 1346
 			throw new UnexpectedEntityException(
1347 1347
 				$datetime,
1348 1348
                 'EE_Datetime',
1349 1349
 				sprintf(
1350
-					__( 'The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'),
1350
+					__('The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'),
1351 1351
 					$this->name()
1352 1352
 				)
1353 1353
 			);
1354 1354
 		}
1355 1355
 		$event = $datetime->event();
1356
-		if ( ! $event instanceof \EE_Event ) {
1356
+		if ( ! $event instanceof \EE_Event) {
1357 1357
 			throw new UnexpectedEntityException(
1358 1358
 				$event,
1359 1359
                 'EE_Event',
1360 1360
 				sprintf(
1361
-					__( 'The ticket (%s) is not associated with a valid event.', 'event_espresso'),
1361
+					__('The ticket (%s) is not associated with a valid event.', 'event_espresso'),
1362 1362
 					$this->name()
1363 1363
 				)
1364 1364
 			);
Please login to merge, or discard this patch.
modules/ticket_selector/DatetimeSelector.php 2 patches
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -16,175 +16,175 @@
 block discarded – undo
16 16
 class DatetimeSelector
17 17
 {
18 18
 
19
-    /**
20
-     * @var \EE_Event $event
21
-     */
22
-    protected $event;
23
-
24
-    /**
25
-     * @var \EE_Ticket[] $tickets
26
-     */
27
-    protected $tickets;
28
-
29
-    /**
30
-     * @var \EE_Datetime[] $datetimes
31
-     */
32
-    protected $datetimes;
33
-
34
-    /**
35
-     * @var \EE_Datetime[] $unique_dates
36
-     */
37
-    protected $unique_dates;
38
-
39
-    /**
40
-     * @var \EE_Ticket_Selector_Config $template_settings
41
-     */
42
-    protected $template_settings;
43
-
44
-    /**
45
-     * @var boolean $active
46
-     */
47
-    protected $active = false;
48
-
49
-
50
-
51
-    /**
52
-     * DatetimeSelector constructor.
53
-     *
54
-     * @param \EE_Event                  $event
55
-     * @param \EE_Ticket[]               $tickets
56
-     * @param \EE_Ticket_Selector_Config $template_settings
57
-     * @param string                     $date_format
58
-     * @param string                     $time_format
59
-     * @throws \EE_Error
60
-     */
61
-    public function __construct(
62
-        \EE_Event $event,
63
-        array $tickets,
64
-        \EE_Ticket_Selector_Config $template_settings,
65
-        $date_format = 'Y-m-d',
66
-        $time_format = 'g:i a'
67
-    ) {
68
-        $this->event = $event;
69
-        $this->tickets = $tickets;
70
-        $this->template_settings = $template_settings;
71
-        $this->datetimes = $this->getAllDatetimesForAllTicket($tickets);
72
-        $this->unique_dates = $this->getUniqueDatetimeOptions($date_format, $time_format);
73
-        $this->active = $this->template_settings->showDatetimeSelector($this->unique_dates);
74
-    }
75
-
76
-
77
-
78
-    /**
79
-     * @param \EE_Ticket[] $tickets
80
-     * @return array
81
-     * @throws \EE_Error
82
-     */
83
-    protected function getAllDatetimesForAllTicket($tickets = array())
84
-    {
85
-        $datetimes = array();
86
-        foreach ($tickets as $ticket) {
87
-            $datetimes = $this->getTicketDatetimes($ticket, $datetimes);
88
-        }
89
-        return $datetimes;
90
-    }
91
-
92
-
93
-
94
-    /**
95
-     * @param \EE_Ticket      $ticket
96
-     * @param  \EE_Datetime[] $datetimes
97
-     * @return \EE_Datetime[]
98
-     * @throws \EE_Error
99
-     */
100
-    protected function getTicketDatetimes(\EE_Ticket $ticket, $datetimes = array())
101
-    {
102
-        $ticket_datetimes = $ticket->datetimes(
103
-            array(
104
-                'order_by'                 => array(
105
-                    'DTT_order'     => 'ASC',
106
-                    'DTT_EVT_start' => 'ASC'
107
-                ),
108
-                'default_where_conditions' => 'none',
109
-            )
110
-        );
111
-        foreach ($ticket_datetimes as $ticket_datetime) {
112
-            if ( ! $ticket_datetime instanceof \EE_Datetime) {
113
-                continue;
114
-            }
115
-            $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime;
116
-        }
117
-        return $datetimes;
118
-    }
119
-
120
-
121
-
122
-    /**
123
-     * @param \EE_Ticket                 $ticket
124
-     * @return string
125
-     * @throws \EE_Error
126
-     */
127
-    public function getTicketDatetimeClasses( \EE_Ticket $ticket ) {
128
-        if ( ! $this->active) {
129
-            return '';
130
-        }
131
-        $ticket_datetimes = $this->getTicketDatetimes($ticket);
132
-        $classes = '';
133
-        foreach ($this->datetimes as $datetime) {
134
-            if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) {
135
-                continue;
136
-            }
137
-            $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
138
-        }
139
-        return $classes;
140
-    }
141
-
142
-
143
-
144
-    /**
145
-     * @param string $date_format
146
-     * @param string $time_format
147
-     * @return array
148
-     * @throws \EE_Error
149
-     */
150
-    public function getUniqueDatetimeOptions($date_format = 'Y-m-d', $time_format = 'g:i a') {
151
-        $datetime_options = array();
152
-        foreach ($this->datetimes as $datetime) {
153
-            if ( ! $datetime instanceof \EE_Datetime) {
154
-                continue;
155
-            }
156
-            $datetime_options[$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_')] =
157
-                $datetime->date_and_time_range($date_format, $time_format, ' - ');
158
-        }
159
-        return $datetime_options;
160
-    }
161
-
162
-
163
-
164
-    /**
165
-     * @return string
166
-     * @throws \EE_Error
167
-     */
168
-    public function getDatetimeSelector() {
169
-        if ( ! $this->active) {
170
-            return '';
171
-        }
172
-        $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input(
173
-            $this->unique_dates,
174
-            array(
175
-                'html_id'               => 'datetime-selector-' . $this->event->ID(),
176
-                'html_name'             => 'datetime_selector_' . $this->event->ID(),
177
-                'html_class'            => 'datetime-selector',
178
-                'select_button_text'       => '<span class="dashicons dashicons-calendar-alt"></span> '
179
-                                            . esc_html__('Filter by Date', 'event_espresso'),
180
-                'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"',
181
-            )
182
-        );
183
-        return \EEH_HTML::div(
184
-            $dropdown_selector->get_html_for_input(),
185
-            '', 'datetime_selector-dv'
186
-        );
187
-    }
19
+	/**
20
+	 * @var \EE_Event $event
21
+	 */
22
+	protected $event;
23
+
24
+	/**
25
+	 * @var \EE_Ticket[] $tickets
26
+	 */
27
+	protected $tickets;
28
+
29
+	/**
30
+	 * @var \EE_Datetime[] $datetimes
31
+	 */
32
+	protected $datetimes;
33
+
34
+	/**
35
+	 * @var \EE_Datetime[] $unique_dates
36
+	 */
37
+	protected $unique_dates;
38
+
39
+	/**
40
+	 * @var \EE_Ticket_Selector_Config $template_settings
41
+	 */
42
+	protected $template_settings;
43
+
44
+	/**
45
+	 * @var boolean $active
46
+	 */
47
+	protected $active = false;
48
+
49
+
50
+
51
+	/**
52
+	 * DatetimeSelector constructor.
53
+	 *
54
+	 * @param \EE_Event                  $event
55
+	 * @param \EE_Ticket[]               $tickets
56
+	 * @param \EE_Ticket_Selector_Config $template_settings
57
+	 * @param string                     $date_format
58
+	 * @param string                     $time_format
59
+	 * @throws \EE_Error
60
+	 */
61
+	public function __construct(
62
+		\EE_Event $event,
63
+		array $tickets,
64
+		\EE_Ticket_Selector_Config $template_settings,
65
+		$date_format = 'Y-m-d',
66
+		$time_format = 'g:i a'
67
+	) {
68
+		$this->event = $event;
69
+		$this->tickets = $tickets;
70
+		$this->template_settings = $template_settings;
71
+		$this->datetimes = $this->getAllDatetimesForAllTicket($tickets);
72
+		$this->unique_dates = $this->getUniqueDatetimeOptions($date_format, $time_format);
73
+		$this->active = $this->template_settings->showDatetimeSelector($this->unique_dates);
74
+	}
75
+
76
+
77
+
78
+	/**
79
+	 * @param \EE_Ticket[] $tickets
80
+	 * @return array
81
+	 * @throws \EE_Error
82
+	 */
83
+	protected function getAllDatetimesForAllTicket($tickets = array())
84
+	{
85
+		$datetimes = array();
86
+		foreach ($tickets as $ticket) {
87
+			$datetimes = $this->getTicketDatetimes($ticket, $datetimes);
88
+		}
89
+		return $datetimes;
90
+	}
91
+
92
+
93
+
94
+	/**
95
+	 * @param \EE_Ticket      $ticket
96
+	 * @param  \EE_Datetime[] $datetimes
97
+	 * @return \EE_Datetime[]
98
+	 * @throws \EE_Error
99
+	 */
100
+	protected function getTicketDatetimes(\EE_Ticket $ticket, $datetimes = array())
101
+	{
102
+		$ticket_datetimes = $ticket->datetimes(
103
+			array(
104
+				'order_by'                 => array(
105
+					'DTT_order'     => 'ASC',
106
+					'DTT_EVT_start' => 'ASC'
107
+				),
108
+				'default_where_conditions' => 'none',
109
+			)
110
+		);
111
+		foreach ($ticket_datetimes as $ticket_datetime) {
112
+			if ( ! $ticket_datetime instanceof \EE_Datetime) {
113
+				continue;
114
+			}
115
+			$datetimes[ $ticket_datetime->ID() ] = $ticket_datetime;
116
+		}
117
+		return $datetimes;
118
+	}
119
+
120
+
121
+
122
+	/**
123
+	 * @param \EE_Ticket                 $ticket
124
+	 * @return string
125
+	 * @throws \EE_Error
126
+	 */
127
+	public function getTicketDatetimeClasses( \EE_Ticket $ticket ) {
128
+		if ( ! $this->active) {
129
+			return '';
130
+		}
131
+		$ticket_datetimes = $this->getTicketDatetimes($ticket);
132
+		$classes = '';
133
+		foreach ($this->datetimes as $datetime) {
134
+			if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) {
135
+				continue;
136
+			}
137
+			$classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
138
+		}
139
+		return $classes;
140
+	}
141
+
142
+
143
+
144
+	/**
145
+	 * @param string $date_format
146
+	 * @param string $time_format
147
+	 * @return array
148
+	 * @throws \EE_Error
149
+	 */
150
+	public function getUniqueDatetimeOptions($date_format = 'Y-m-d', $time_format = 'g:i a') {
151
+		$datetime_options = array();
152
+		foreach ($this->datetimes as $datetime) {
153
+			if ( ! $datetime instanceof \EE_Datetime) {
154
+				continue;
155
+			}
156
+			$datetime_options[$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_')] =
157
+				$datetime->date_and_time_range($date_format, $time_format, ' - ');
158
+		}
159
+		return $datetime_options;
160
+	}
161
+
162
+
163
+
164
+	/**
165
+	 * @return string
166
+	 * @throws \EE_Error
167
+	 */
168
+	public function getDatetimeSelector() {
169
+		if ( ! $this->active) {
170
+			return '';
171
+		}
172
+		$dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input(
173
+			$this->unique_dates,
174
+			array(
175
+				'html_id'               => 'datetime-selector-' . $this->event->ID(),
176
+				'html_name'             => 'datetime_selector_' . $this->event->ID(),
177
+				'html_class'            => 'datetime-selector',
178
+				'select_button_text'       => '<span class="dashicons dashicons-calendar-alt"></span> '
179
+											. esc_html__('Filter by Date', 'event_espresso'),
180
+				'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"',
181
+			)
182
+		);
183
+		return \EEH_HTML::div(
184
+			$dropdown_selector->get_html_for_input(),
185
+			'', 'datetime_selector-dv'
186
+		);
187
+	}
188 188
 
189 189
 
190 190
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             if ( ! $ticket_datetime instanceof \EE_Datetime) {
113 113
                 continue;
114 114
             }
115
-            $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime;
115
+            $datetimes[$ticket_datetime->ID()] = $ticket_datetime;
116 116
         }
117 117
         return $datetimes;
118 118
     }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      * @return string
125 125
      * @throws \EE_Error
126 126
      */
127
-    public function getTicketDatetimeClasses( \EE_Ticket $ticket ) {
127
+    public function getTicketDatetimeClasses(\EE_Ticket $ticket) {
128 128
         if ( ! $this->active) {
129 129
             return '';
130 130
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) {
135 135
                 continue;
136 136
             }
137
-            $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
137
+            $classes .= ' ee-ticket-datetimes-'.$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
138 138
         }
139 139
         return $classes;
140 140
     }
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
         $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input(
173 173
             $this->unique_dates,
174 174
             array(
175
-                'html_id'               => 'datetime-selector-' . $this->event->ID(),
176
-                'html_name'             => 'datetime_selector_' . $this->event->ID(),
175
+                'html_id'               => 'datetime-selector-'.$this->event->ID(),
176
+                'html_name'             => 'datetime_selector_'.$this->event->ID(),
177 177
                 'html_class'            => 'datetime-selector',
178 178
                 'select_button_text'       => '<span class="dashicons dashicons-calendar-alt"></span> '
179 179
                                             . esc_html__('Filter by Date', 'event_espresso'),
180
-                'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"',
180
+                'other_html_attributes' => ' data-tkt_slctr_evt="'.$this->event->ID().'"',
181 181
             )
182 182
         );
183 183
         return \EEH_HTML::div(
Please login to merge, or discard this patch.
modules/ticket_selector/templates/standard_ticket_selector.template.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 			<tr>
29 29
 				<th scope="col" class="ee-ticket-selector-ticket-details-th">
30 30
 					<?php
31
-                    echo apply_filters(
32
-                        'FHEE__ticket_selector_chart_template__table_header_available_tickets',
33
-                        esc_html(''),
34
-                        $EVT_ID
35
-                    );
36
-                    ?>
31
+					echo apply_filters(
32
+						'FHEE__ticket_selector_chart_template__table_header_available_tickets',
33
+						esc_html(''),
34
+						$EVT_ID
35
+					);
36
+					?>
37 37
 				</th>
38 38
 				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
39 39
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
@@ -47,28 +47,28 @@  discard block
 block discarded – undo
47 47
 						 * @param int $EVT_ID The Event ID
48 48
 						 */
49 49
 						echo apply_filters(
50
-                            'FHEE__ticket_selector_chart_template__table_header_price',
51
-                            esc_html__( 'Price', 'event_espresso' ),
52
-                            $EVT_ID
53
-                        );
50
+							'FHEE__ticket_selector_chart_template__table_header_price',
51
+							esc_html__( 'Price', 'event_espresso' ),
52
+							$EVT_ID
53
+						);
54 54
 					?>
55 55
 				</th>
56 56
 				<?php } ?>
57 57
 				<th scope="col" class="ee-ticket-selector-ticket-qty-th cntr">
58 58
 					<?php
59 59
 						/**
60
-						* Filters the text printed for the header of the quantity column in the ticket selector table
61
-						*
62
-						* @since 4.7.2
63
-						*
64
-						* @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
65
-						* @param int $EVT_ID The Event ID
66
-						*/
60
+						 * Filters the text printed for the header of the quantity column in the ticket selector table
61
+						 *
62
+						 * @since 4.7.2
63
+						 *
64
+						 * @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
65
+						 * @param int $EVT_ID The Event ID
66
+						 */
67 67
 						echo apply_filters(
68
-                            'FHEE__ticket_selector_chart_template__table_header_qty',
69
-                            esc_html__( 'Qty', 'event_espresso' ),
70
-                            $EVT_ID
71
-                        );
68
+							'FHEE__ticket_selector_chart_template__table_header_qty',
69
+							esc_html__( 'Qty', 'event_espresso' ),
70
+							$EVT_ID
71
+						);
72 72
 					?>
73 73
 				</th>
74 74
 			</tr>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 if ( $max_atndz > 0 ) {
99 99
 	echo apply_filters(
100 100
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
101
-        esc_html('')
101
+		esc_html('')
102 102
 	);
103 103
 }
104 104
 if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 ?>
22 22
 <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv">
23 23
 
24
-	<?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?>
24
+	<?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?>
25 25
 	<?php echo $datetime_selector; ?>
26 26
 
27 27
 	<table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl">
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                     );
37 37
                     ?>
38 38
 				</th>
39
-				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
39
+				<?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
40 40
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
41 41
 					<?php
42 42
 						/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 						 */
50 50
 						echo apply_filters(
51 51
                             'FHEE__ticket_selector_chart_template__table_header_price',
52
-                            esc_html__( 'Price', 'event_espresso' ),
52
+                            esc_html__('Price', 'event_espresso'),
53 53
                             $EVT_ID
54 54
                         );
55 55
 					?>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 						*/
68 68
 						echo apply_filters(
69 69
                             'FHEE__ticket_selector_chart_template__table_header_qty',
70
-                            esc_html__( 'Qty', 'event_espresso' ),
70
+                            esc_html__('Qty', 'event_espresso'),
71 71
                             $EVT_ID
72 72
                         );
73 73
 					?>
@@ -75,17 +75,17 @@  discard block
 block discarded – undo
75 75
 			</tr>
76 76
 		</thead>
77 77
 		<tbody>
78
-			<?php echo $ticket_row_html;?>
78
+			<?php echo $ticket_row_html; ?>
79 79
 		</tbody>
80 80
 	</table>
81 81
 	<?php
82
-	if ( $taxable_tickets && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', true ) ) {
83
-		if ( $prices_displayed_including_taxes ) {
84
-			$ticket_price_includes_taxes = esc_html__( '* price includes taxes', 'event_espresso' );
82
+	if ($taxable_tickets && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
83
+		if ($prices_displayed_including_taxes) {
84
+			$ticket_price_includes_taxes = esc_html__('* price includes taxes', 'event_espresso');
85 85
 		} else {
86
-			$ticket_price_includes_taxes = esc_html__( '* price does not include taxes', 'event_espresso' );
86
+			$ticket_price_includes_taxes = esc_html__('* price does not include taxes', 'event_espresso');
87 87
 		}
88
-		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">' . $ticket_price_includes_taxes . '</p>';
88
+		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">'.$ticket_price_includes_taxes.'</p>';
89 89
 	}
90 90
 	?>
91 91
 
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 
94 94
 
95 95
 <?php
96
-if ( $max_atndz > 0 ) {
96
+if ($max_atndz > 0) {
97 97
 	echo apply_filters(
98 98
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
99 99
         esc_html('')
100 100
 	);
101 101
 }
102
-if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
103
-	add_filter( 'FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true' );
102
+if ( ! apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) {
103
+	add_filter('FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true');
104 104
 }
105
-do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event );
106 105
\ No newline at end of file
106
+do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event);
107 107
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_details.template.php 2 patches
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
                 <p><?php echo $ticket->description(); ?></p>
23 23
 
24 24
                 <?php
25
-                do_action(
26
-                    'AHEE__ticket_selector_chart_template__ticket_details__after_description',
27
-                    $ticket,
28
-                    $ticket_price,
29
-                    $display_ticket_price
30
-                );
31
-                ?>
25
+				do_action(
26
+					'AHEE__ticket_selector_chart_template__ticket_details__after_description',
27
+					$ticket,
28
+					$ticket_price,
29
+					$display_ticket_price
30
+				);
31
+				?>
32 32
 
33 33
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
34 34
                     <h5><?php echo apply_filters(
35
-                        'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
-                        esc_html__( 'Sale Dates', 'event_espresso' )
37
-                        ); ?>
35
+						'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
+						esc_html__( 'Sale Dates', 'event_espresso' )
37
+						); ?>
38 38
                     </h5>
39 39
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
40
-                        'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
-                        esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
42
-                        ); ?></span>
40
+						'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
+						esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
42
+						); ?></span>
43 43
                     <br/>
44 44
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
45
-                        'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
-                        esc_html__( 'Goes On Sale:', 'event_espresso' )
47
-                        ); ?></span>
45
+						'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
+						esc_html__( 'Goes On Sale:', 'event_espresso' )
47
+						); ?></span>
48 48
                     <span class="dashicons dashicons-calendar"></span>
49 49
                     <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
50 50
                     <span  class="dashicons dashicons-clock"></span>
51 51
                     <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
52 52
                     <br/>
53 53
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
54
-                        'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
-                        esc_html__( 'Sales End:', 'event_espresso' )
56
-                        ); ?></span>
54
+						'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
+						esc_html__( 'Sales End:', 'event_espresso' )
56
+						); ?></span>
57 57
                     <span class="dashicons dashicons-calendar"></span>
58 58
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
59 59
                     <span class="dashicons dashicons-clock"></span>
@@ -67,34 +67,34 @@  discard block
 block discarded – undo
67 67
                 <?php if ( $ticket->min() && $ticket->max() ) { ?>
68 68
                     <section class="tckt-slctr-tkt-quantities-sctn">
69 69
                         <h5><?php echo apply_filters(
70
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
-                            esc_html__( 'Purchasable Quantities', 'event_espresso' )
72
-                            ); ?></h5>
70
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
+							esc_html__( 'Purchasable Quantities', 'event_espresso' )
72
+							); ?></h5>
73 73
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
74
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
75
-                            esc_html__(
76
-                            'The number of tickets that can be purchased per transaction (if available).',
77
-                            'event_espresso'
78
-                            )
79
-                            ); ?></span><br/>
74
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
75
+							esc_html__(
76
+							'The number of tickets that can be purchased per transaction (if available).',
77
+							'event_espresso'
78
+							)
79
+							); ?></span><br/>
80 80
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
81
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
-                            esc_html__( 'Minimum Qty:', 'event_espresso' )
83
-                            ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
81
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
+							esc_html__( 'Minimum Qty:', 'event_espresso' )
83
+							); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
84 84
                         <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
85 85
                         class="important-notice small-text"><?php echo apply_filters(
86
-                        'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87
-                        esc_html__(
88
-                        'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining',
89
-                        'event_espresso'
90
-                        )
91
-                        ); ?></span><?php } ?><br/>
86
+						'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87
+						esc_html__(
88
+						'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining',
89
+						'event_espresso'
90
+						)
91
+						); ?></span><?php } ?><br/>
92 92
                         <?php //$max = min( $max, $max_atndz );?>
93 93
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
94
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
-                            esc_html__( 'Maximum Qty:', 'event_espresso' )
96
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
-                        : max( $ticket->max(), 1 ); ?><br/>
94
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
+							esc_html__( 'Maximum Qty:', 'event_espresso' )
96
+							); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
+						: max( $ticket->max(), 1 ); ?><br/>
98 98
                     </section>
99 99
                     <br/>
100 100
                 <?php } ?>
@@ -102,43 +102,43 @@  discard block
 block discarded – undo
102 102
                 <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
103 103
                     <section class="tckt-slctr-tkt-uses-sctn">
104 104
                         <h5><?php echo apply_filters(
105
-                                'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
-                                esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
107
-                            ); ?></h5>
105
+								'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
+								esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
107
+							); ?></h5>
108 108
                         <span class="drk-grey-text small-text no-bold"> - <?php
109
-                            echo apply_filters(
110
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
111
-                            sprintf(
112
-                                esc_html__(
113
-                                    'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s',
114
-                                    'event_espresso'
115
-                                ),
116
-                                '<br/>',
117
-                                '<strong>',
118
-                                '</strong>'
119
-                                )
120
-                            );
121
-                            ?></span><br/>
109
+							echo apply_filters(
110
+							'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
111
+							sprintf(
112
+								esc_html__(
113
+									'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s',
114
+									'event_espresso'
115
+								),
116
+								'<br/>',
117
+								'<strong>',
118
+								'</strong>'
119
+								)
120
+							);
121
+							?></span><br/>
122 122
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
123
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
-                            esc_html__( '# Datetimes:', 'event_espresso' )
125
-                            ); ?></span><?php echo $ticket->uses(); ?><br/>
123
+							'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
+							esc_html__( '# Datetimes:', 'event_espresso' )
125
+							); ?></span><?php echo $ticket->uses(); ?><br/>
126 126
                     </section>
127 127
                 <?php } ?>
128 128
 
129 129
                 <?php
130
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
131
-                $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
-                if ( ! empty( $datetimes ) ) { ?>
130
+				$datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
131
+				$chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
+				if ( ! empty( $datetimes ) ) { ?>
133 133
                     <section class="tckt-slctr-tkt-datetimes-sctn">
134 134
                         <h5><?php echo apply_filters(
135
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
-                            esc_html__( 'Access', 'event_espresso' )
137
-                            ); ?></h5>
135
+							'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
+							esc_html__( 'Access', 'event_espresso' )
137
+							); ?></h5>
138 138
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
139
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
-                            esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
141
-                            ); ?></span>
139
+							'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
+							esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
141
+							); ?></span>
142 142
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
143 143
                             <table class="tckt-slctr-tkt-details-tbl">
144 144
                                 <thead>
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
                                     <th class="tckt-slctr-tkt-details-date-th">
147 147
                                         <span class="dashicons dashicons-calendar"></span><span
148 148
                                         class="small-text"><?php echo apply_filters(
149
-                                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
-                                            esc_html__( 'Date ', 'event_espresso' )
151
-                                            ); ?></span>
149
+											'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
+											esc_html__( 'Date ', 'event_espresso' )
151
+											); ?></span>
152 152
                                     </th>
153 153
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
154 154
                                         <span class="dashicons dashicons-clock"></span><span
@@ -157,98 +157,98 @@  discard block
 block discarded – undo
157 157
                                     <?php if ( $show_ticket_sale_columns ) : ?>
158 158
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
159 159
                                             <span class="smaller-text"><?php echo apply_filters(
160
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
-                                                sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
162
-                                                ); ?></span>
160
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
+												sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
162
+												); ?></span>
163 163
                                         </th>
164 164
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
165 165
                                             <span class="smaller-text"><?php echo apply_filters(
166
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
-                                                sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
168
-                                                ); ?></span>
166
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
+												sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
168
+												); ?></span>
169 169
                                         </th>
170 170
                                         <th
171 171
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
172 172
                                             <span class="smaller-text"><?php echo apply_filters(
173
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
-                                                sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
175
-                                                ); ?></span>
173
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
+												sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
175
+												); ?></span>
176 176
                                         </th>
177 177
                                         <th
178 178
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
179 179
                                             <span class="smaller-text"><?php echo apply_filters(
180
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
-                                                sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
182
-                                                ); ?></span>
180
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
+												sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
182
+												); ?></span>
183 183
                                         </th>
184 184
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
185 185
                                 </tr>
186 186
                                 </thead>
187 187
                                 <tbody>
188 188
                                 <?php
189
-                                foreach ( $datetimes as $datetime ) {
190
-                                    if ( $datetime instanceof EE_Datetime ) {
191
-                                        ?>
189
+								foreach ( $datetimes as $datetime ) {
190
+									if ( $datetime instanceof EE_Datetime ) {
191
+										?>
192 192
 
193 193
                                         <tr>
194 194
                                             <td data-th="<?php echo apply_filters(
195
-                                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
-                                            esc_html__( 'Event Date ', 'event_espresso' )
197
-                                            ); ?>" class="small-text">
195
+											'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
+											esc_html__( 'Event Date ', 'event_espresso' )
197
+											); ?>" class="small-text">
198 198
                                                 <?php $datetime_name = $datetime->name(); ?>
199 199
                                                 <?php echo ! empty( $datetime_name ) ? '<b>'
200
-                                                                                       . $datetime_name
201
-                                                                                       . '</b><br/>' : ''; ?>
200
+																					   . $datetime_name
201
+																					   . '</b><br/>' : ''; ?>
202 202
                                                 <?php echo $datetime->date_range(
203
-                                                $date_format,
204
-                                                esc_html__( ' to  ', 'event_espresso' )
205
-                                                ); ?>
203
+												$date_format,
204
+												esc_html__( ' to  ', 'event_espresso' )
205
+												); ?>
206 206
                                             </td>
207 207
                                             <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>"
208 208
                                                 class="cntr small-text">
209 209
                                                 <?php echo $datetime->time_range(
210
-                                                $time_format,
211
-                                                esc_html__( ' to  ', 'event_espresso' )
212
-                                                ); ?>
210
+												$time_format,
211
+												esc_html__( ' to  ', 'event_espresso' )
212
+												); ?>
213 213
                                             </td>
214 214
                                             <?php if ( $show_ticket_sale_columns ) : ?>
215 215
                                                 <td data-th="<?php echo apply_filters(
216
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
-                                                esc_html__( 'Sold', 'event_espresso' )
218
-                                                ); ?>" class="cntr small-text">
216
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
+												esc_html__( 'Sold', 'event_espresso' )
218
+												); ?>" class="cntr small-text">
219 219
                                                     <?php echo $ticket->sold(); ?>
220 220
                                                 </td>
221 221
                                                 <td data-th="<?php echo apply_filters(
222
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
-                                                esc_html__( 'Remaining', 'event_espresso' )
224
-                                                ); ?>" class="cntr small-text">
222
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
+												esc_html__( 'Remaining', 'event_espresso' )
224
+												); ?>" class="cntr small-text">
225 225
                                                     <?php echo $remaining === EE_INF
226
-                                                    ? '<span class="smaller-text">' . esc_html__(
227
-                                                    'unlimited ',
228
-                                                    'event_espresso'
229
-                                                    ) . '</span>' : $remaining; ?>
226
+													? '<span class="smaller-text">' . esc_html__(
227
+													'unlimited ',
228
+													'event_espresso'
229
+													) . '</span>' : $remaining; ?>
230 230
                                                 </td>
231 231
                                                 <td data-th="<?php echo apply_filters(
232
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
-                                                esc_html__( 'Total Sold', 'event_espresso' )
234
-                                                ); ?>" class="cntr small-text">
232
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
+												esc_html__( 'Total Sold', 'event_espresso' )
234
+												); ?>" class="cntr small-text">
235 235
                                                     <?php echo $datetime->sold(); ?>
236 236
                                                 </td>
237 237
                                                 <?php $tkts_left = $datetime->sold_out()
238
-                                                ? '<span class="sold-out smaller-text">' . esc_html__(
239
-                                                'Sold&nbsp;Out',
240
-                                                'event_espresso'
241
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
238
+												? '<span class="sold-out smaller-text">' . esc_html__(
239
+												'Sold&nbsp;Out',
240
+												'event_espresso'
241
+												) . '</span>' : $datetime->spaces_remaining(); ?>
242 242
                                                 <td data-th="<?php echo apply_filters(
243
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
-                                                esc_html__( 'Total Spaces Left', 'event_espresso' )
245
-                                                ); ?>" class="cntr small-text">
243
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
+												esc_html__( 'Total Spaces Left', 'event_espresso' )
245
+												); ?>" class="cntr small-text">
246 246
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
247
-                                                                                       . esc_html__(
248
-                                                                                       'unlimited ',
249
-                                                                                       'event_espresso'
250
-                                                                                       )
251
-                                                                                       . '</span>' : $tkts_left; ?>
247
+																					   . esc_html__(
248
+																					   'unlimited ',
249
+																					   'event_espresso'
250
+																					   )
251
+																					   . '</span>' : $tkts_left; ?>
252 252
                                                 </td>
253 253
                                             <?php endif; //end $show_ticket_sale_columns conditional ?>
254 254
                                         </tr>
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
 /** @var string $price_breakdown_heading */
13 13
 /** @var \EventEspresso\modules\ticket_selector\TicketDetails $ticket_details */
14 14
 ?>
15
-<?php if ( $show_ticket_details ) : ?>
15
+<?php if ($show_ticket_details) : ?>
16 16
 <tr class="tckt-slctr-tkt-details-tr <?php echo $ticket_details_row_class; ?>">
17 17
     <td class="tckt-slctr-tkt-details-td" colspan="<?php echo $cols; ?>">
18 18
         <div id="<?php echo $ticket_details_css_id; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;">
19 19
 
20 20
             <section class="tckt-slctr-tkt-details-sctn">
21
-                <h3><?php echo esc_html__( 'Details', 'event_espresso' ); ?></h3>
21
+                <h3><?php echo esc_html__('Details', 'event_espresso'); ?></h3>
22 22
                 <p><?php echo $ticket->description(); ?></p>
23 23
 
24 24
                 <?php
@@ -33,42 +33,42 @@  discard block
 block discarded – undo
33 33
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
34 34
                     <h5><?php echo apply_filters(
35 35
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
-                        esc_html__( 'Sale Dates', 'event_espresso' )
36
+                        esc_html__('Sale Dates', 'event_espresso')
37 37
                         ); ?>
38 38
                     </h5>
39 39
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
40 40
                         'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
-                        esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
41
+                        esc_html__('The dates when this option is available for purchase.', 'event_espresso')
42 42
                         ); ?></span>
43 43
                     <br/>
44 44
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
45 45
                         'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
-                        esc_html__( 'Goes On Sale:', 'event_espresso' )
46
+                        esc_html__('Goes On Sale:', 'event_espresso')
47 47
                         ); ?></span>
48 48
                     <span class="dashicons dashicons-calendar"></span>
49
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
49
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' &nbsp; '; ?>
50 50
                     <span  class="dashicons dashicons-clock"></span>
51
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
51
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?>
52 52
                     <br/>
53 53
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
54 54
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
-                        esc_html__( 'Sales End:', 'event_espresso' )
55
+                        esc_html__('Sales End:', 'event_espresso')
56 56
                         ); ?></span>
57 57
                     <span class="dashicons dashicons-calendar"></span>
58
-                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
58
+                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' &nbsp; '; ?>
59 59
                     <span class="dashicons dashicons-clock"></span>
60 60
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?>
61 61
                     <br/>
62 62
                 </section>
63 63
                 <br/>
64 64
 
65
-                <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?>
65
+                <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?>
66 66
 
67
-                <?php if ( $ticket->min() && $ticket->max() ) { ?>
67
+                <?php if ($ticket->min() && $ticket->max()) { ?>
68 68
                     <section class="tckt-slctr-tkt-quantities-sctn">
69 69
                         <h5><?php echo apply_filters(
70 70
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
-                            esc_html__( 'Purchasable Quantities', 'event_espresso' )
71
+                            esc_html__('Purchasable Quantities', 'event_espresso')
72 72
                             ); ?></h5>
73 73
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
74 74
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
                             ); ?></span><br/>
80 80
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
81 81
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
-                            esc_html__( 'Minimum Qty:', 'event_espresso' )
82
+                            esc_html__('Minimum Qty:', 'event_espresso')
83 83
                             ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
84
-                        <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
84
+                        <?php if ($ticket->min() > $remaining) { ?> &nbsp; <span
85 85
                         class="important-notice small-text"><?php echo apply_filters(
86 86
                         'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87 87
                         esc_html__(
@@ -92,18 +92,18 @@  discard block
 block discarded – undo
92 92
                         <?php //$max = min( $max, $max_atndz );?>
93 93
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
94 94
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
-                            esc_html__( 'Maximum Qty:', 'event_espresso' )
96
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
-                        : max( $ticket->max(), 1 ); ?><br/>
95
+                            esc_html__('Maximum Qty:', 'event_espresso')
96
+                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__('no limit', 'event_espresso')
97
+                        : max($ticket->max(), 1); ?><br/>
98 98
                     </section>
99 99
                     <br/>
100 100
                 <?php } ?>
101 101
 
102
-                <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
102
+                <?php if (( ! defined('EE_DECAF') || EE_DECAF !== true) && $ticket->uses() !== EE_INF) { ?>
103 103
                     <section class="tckt-slctr-tkt-uses-sctn">
104 104
                         <h5><?php echo apply_filters(
105 105
                                 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
-                                esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
106
+                                esc_html__('Event Date Ticket Uses', 'event_espresso')
107 107
                             ); ?></h5>
108 108
                         <span class="drk-grey-text small-text no-bold"> - <?php
109 109
                             echo apply_filters(
@@ -121,23 +121,23 @@  discard block
 block discarded – undo
121 121
                             ?></span><br/>
122 122
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
123 123
                             'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
-                            esc_html__( '# Datetimes:', 'event_espresso' )
124
+                            esc_html__('# Datetimes:', 'event_espresso')
125 125
                             ); ?></span><?php echo $ticket->uses(); ?><br/>
126 126
                     </section>
127 127
                 <?php } ?>
128 128
 
129 129
                 <?php
130
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
130
+                $datetimes = $ticket->datetimes_ordered($event_is_expired, false);
131 131
                 $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
-                if ( ! empty( $datetimes ) ) { ?>
132
+                if ( ! empty($datetimes)) { ?>
133 133
                     <section class="tckt-slctr-tkt-datetimes-sctn">
134 134
                         <h5><?php echo apply_filters(
135 135
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
-                            esc_html__( 'Access', 'event_espresso' )
136
+                            esc_html__('Access', 'event_espresso')
137 137
                             ); ?></h5>
138 138
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
139 139
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
-                            esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
140
+                            esc_html__('This option allows access to the following dates and times.', 'event_espresso')
141 141
                             ); ?></span>
142 142
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
143 143
                             <table class="tckt-slctr-tkt-details-tbl">
@@ -147,38 +147,38 @@  discard block
 block discarded – undo
147 147
                                         <span class="dashicons dashicons-calendar"></span><span
148 148
                                         class="small-text"><?php echo apply_filters(
149 149
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
-                                            esc_html__( 'Date ', 'event_espresso' )
150
+                                            esc_html__('Date ', 'event_espresso')
151 151
                                             ); ?></span>
152 152
                                     </th>
153 153
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
154 154
                                         <span class="dashicons dashicons-clock"></span><span
155
-                                        class="small-text"><?php esc_html_e( 'Time ', 'event_espresso' ); ?></span>
155
+                                        class="small-text"><?php esc_html_e('Time ', 'event_espresso'); ?></span>
156 156
                                     </th>
157
-                                    <?php if ( $show_ticket_sale_columns ) : ?>
157
+                                    <?php if ($show_ticket_sale_columns) : ?>
158 158
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
159 159
                                             <span class="smaller-text"><?php echo apply_filters(
160 160
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
-                                                sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
161
+                                                sprintf(esc_html__('Sold', 'event_espresso'), '<br/>')
162 162
                                                 ); ?></span>
163 163
                                         </th>
164 164
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
165 165
                                             <span class="smaller-text"><?php echo apply_filters(
166 166
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
-                                                sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
167
+                                                sprintf(esc_html__('Remaining', 'event_espresso'), '<br/>')
168 168
                                                 ); ?></span>
169 169
                                         </th>
170 170
                                         <th
171 171
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
172 172
                                             <span class="smaller-text"><?php echo apply_filters(
173 173
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
-                                                sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
174
+                                                sprintf(esc_html__('Total%sSold', 'event_espresso'), '<br/>')
175 175
                                                 ); ?></span>
176 176
                                         </th>
177 177
                                         <th
178 178
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
179 179
                                             <span class="smaller-text"><?php echo apply_filters(
180 180
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
-                                                sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
181
+                                                sprintf(esc_html__('Total Spaces%sLeft', 'event_espresso'), '<br/>')
182 182
                                                 ); ?></span>
183 183
                                         </th>
184 184
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
@@ -186,62 +186,62 @@  discard block
 block discarded – undo
186 186
                                 </thead>
187 187
                                 <tbody>
188 188
                                 <?php
189
-                                foreach ( $datetimes as $datetime ) {
190
-                                    if ( $datetime instanceof EE_Datetime ) {
189
+                                foreach ($datetimes as $datetime) {
190
+                                    if ($datetime instanceof EE_Datetime) {
191 191
                                         ?>
192 192
 
193 193
                                         <tr>
194 194
                                             <td data-th="<?php echo apply_filters(
195 195
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
-                                            esc_html__( 'Event Date ', 'event_espresso' )
196
+                                            esc_html__('Event Date ', 'event_espresso')
197 197
                                             ); ?>" class="small-text">
198 198
                                                 <?php $datetime_name = $datetime->name(); ?>
199
-                                                <?php echo ! empty( $datetime_name ) ? '<b>'
199
+                                                <?php echo ! empty($datetime_name) ? '<b>'
200 200
                                                                                        . $datetime_name
201 201
                                                                                        . '</b><br/>' : ''; ?>
202 202
                                                 <?php echo $datetime->date_range(
203 203
                                                 $date_format,
204
-                                                esc_html__( ' to  ', 'event_espresso' )
204
+                                                esc_html__(' to  ', 'event_espresso')
205 205
                                                 ); ?>
206 206
                                             </td>
207
-                                            <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>"
207
+                                            <td data-th="<?php esc_html_e('Time ', 'event_espresso'); ?>"
208 208
                                                 class="cntr small-text">
209 209
                                                 <?php echo $datetime->time_range(
210 210
                                                 $time_format,
211
-                                                esc_html__( ' to  ', 'event_espresso' )
211
+                                                esc_html__(' to  ', 'event_espresso')
212 212
                                                 ); ?>
213 213
                                             </td>
214
-                                            <?php if ( $show_ticket_sale_columns ) : ?>
214
+                                            <?php if ($show_ticket_sale_columns) : ?>
215 215
                                                 <td data-th="<?php echo apply_filters(
216 216
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
-                                                esc_html__( 'Sold', 'event_espresso' )
217
+                                                esc_html__('Sold', 'event_espresso')
218 218
                                                 ); ?>" class="cntr small-text">
219 219
                                                     <?php echo $ticket->sold(); ?>
220 220
                                                 </td>
221 221
                                                 <td data-th="<?php echo apply_filters(
222 222
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
-                                                esc_html__( 'Remaining', 'event_espresso' )
223
+                                                esc_html__('Remaining', 'event_espresso')
224 224
                                                 ); ?>" class="cntr small-text">
225 225
                                                     <?php echo $remaining === EE_INF
226
-                                                    ? '<span class="smaller-text">' . esc_html__(
226
+                                                    ? '<span class="smaller-text">'.esc_html__(
227 227
                                                     'unlimited ',
228 228
                                                     'event_espresso'
229
-                                                    ) . '</span>' : $remaining; ?>
229
+                                                    ).'</span>' : $remaining; ?>
230 230
                                                 </td>
231 231
                                                 <td data-th="<?php echo apply_filters(
232 232
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
-                                                esc_html__( 'Total Sold', 'event_espresso' )
233
+                                                esc_html__('Total Sold', 'event_espresso')
234 234
                                                 ); ?>" class="cntr small-text">
235 235
                                                     <?php echo $datetime->sold(); ?>
236 236
                                                 </td>
237 237
                                                 <?php $tkts_left = $datetime->sold_out()
238
-                                                ? '<span class="sold-out smaller-text">' . esc_html__(
238
+                                                ? '<span class="sold-out smaller-text">'.esc_html__(
239 239
                                                 'Sold&nbsp;Out',
240 240
                                                 'event_espresso'
241
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
241
+                                                ).'</span>' : $datetime->spaces_remaining(); ?>
242 242
                                                 <td data-th="<?php echo apply_filters(
243 243
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
-                                                esc_html__( 'Total Spaces Left', 'event_espresso' )
244
+                                                esc_html__('Total Spaces Left', 'event_espresso')
245 245
                                                 ); ?>" class="cntr small-text">
246 246
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
247 247
                                                                                        . esc_html__(
@@ -266,4 +266,4 @@  discard block
 block discarded – undo
266 266
         </div>
267 267
     </td>
268 268
 </tr>
269
-<?php endif;  //end template_settings->show_ticket_details check?>
270 269
\ No newline at end of file
270
+<?php endif; //end template_settings->show_ticket_details check?>
271 271
\ No newline at end of file
Please login to merge, or discard this patch.
ticket_selector_caff/templates/ticket_selector_price_details.template.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 if ($display_ticket_price) { ?>
8 8
     <section class="tckt-slctr-tkt-price-sctn">
9 9
         <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading',
10
-                esc_html__('Price', 'event_espresso')); ?></h5>
10
+				esc_html__('Price', 'event_espresso')); ?></h5>
11 11
         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
12 12
             <table class="tckt-slctr-tkt-details-tbl">
13 13
                 <thead>
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
                             class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td>
31 31
                     </tr>
32 32
                     <?php
33
-                    $running_total = $ticket->base_price()->amount();
34
-                } else {
35
-                    $running_total = 0;
36
-                }
37
-                // now add price modifiers
38
-                foreach ($ticket->price_modifiers() as $price_mod) { ?>
33
+					$running_total = $ticket->base_price()->amount();
34
+				} else {
35
+					$running_total = 0;
36
+				}
37
+				// now add price modifiers
38
+				foreach ($ticket->price_modifiers() as $price_mod) { ?>
39 39
                     <tr>
40 40
                         <td data-th="<?php esc_html_e('Name', 'event_espresso'); ?>"
41 41
                             class="jst-rght small-text"><?php echo $price_mod->name(); ?></td>
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
                                 %
46 46
                             </td>
47 47
                             <?php
48
-                            $new_sub_total = $running_total * ($price_mod->amount() / 100);
49
-                            $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total;
50
-                            ?>
48
+							$new_sub_total = $running_total * ($price_mod->amount() / 100);
49
+							$new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total;
50
+							?>
51 51
                         <?php } else { ?>
52 52
                             <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1
53
-                                : $price_mod->amount(); ?>
53
+								: $price_mod->amount(); ?>
54 54
                             <td data-th="<?php esc_html_e('Description', 'event_espresso'); ?>"
55 55
                                 class="small-text"><?php echo $price_mod->desc(); ?></td>
56 56
                             <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1
57
-                                : $price_mod->amount(); ?>
57
+								: $price_mod->amount(); ?>
58 58
                         <?php } ?>
59 59
                         <td data-th="<?php esc_html_e('Amount', 'event_espresso'); ?>"
60 60
                             class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                     <?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?>
66 66
                     <tr>
67 67
                         <td colspan="2" class="jst-rght small-text sbttl"><b><?php esc_html_e('subtotal',
68
-                                    'event_espresso'); ?></b></td>
68
+									'event_espresso'); ?></b></td>
69 69
                         <td data-th="<?php esc_html_e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text">
70 70
                             <b><?php echo EEH_Template::format_currency($running_total); ?></b></td>
71 71
                     </tr>
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
                 <tr>
88 88
                     <td colspan="2" class="jst-rght small-text ttl-lbl-td">
89 89
                         <b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price',
90
-                                esc_html__('Total', 'event_espresso')); ?></b></td>
90
+								esc_html__('Total', 'event_espresso')); ?></b></td>
91 91
                     <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price',
92
-                        esc_html__('Total', 'event_espresso')); ?>" class="jst-rght small-text">
92
+						esc_html__('Total', 'event_espresso')); ?>" class="jst-rght small-text">
93 93
                         <b><?php echo EEH_Template::format_currency($running_total); ?></b></td>
94 94
                 </tr>
95 95
                 </tbody>
Please login to merge, or discard this patch.
core/domain/services/capabilities/CapCheck.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
 
40 40
     /**
41
-     * @param string|array $capability   - the capability to be checked, like: 'ee_edit_registrations',
41
+     * @param string $capability   - the capability to be checked, like: 'ee_edit_registrations',
42 42
      *                                   or an array of capability strings
43 43
      * @param string       $context      - what the user is attempting to do, like: 'Edit Registration'
44 44
      * @param int          $ID           - (optional) ID for item where current_user_can is being called from
Please login to merge, or discard this patch.
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use EventEspresso\core\exceptions\InvalidDataTypeException;
5 5
 
6 6
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
-    exit('No direct script access allowed');
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -20,72 +20,72 @@  discard block
 block discarded – undo
20 20
 class CapCheck implements CapCheckInterface
21 21
 {
22 22
 
23
-    /**
24
-     * @var string|array $capability
25
-     */
26
-    private $capability;
27
-
28
-    /**
29
-     * @var string $context
30
-     */
31
-    private $context;
32
-
33
-    /**
34
-     * @var int|string $ID
35
-     */
36
-    private $ID;
37
-
38
-
39
-
40
-    /**
41
-     * @param string|array $capability   - the capability to be checked, like: 'ee_edit_registrations',
42
-     *                                   or an array of capability strings
43
-     * @param string       $context      - what the user is attempting to do, like: 'Edit Registration'
44
-     * @param int          $ID           - (optional) ID for item where current_user_can is being called from
45
-     * @throws InvalidDataTypeException
46
-     */
47
-    public function __construct($capability, $context, $ID = 0)
48
-    {
49
-        if ( ! is_string($capability)) {
50
-            throw new InvalidDataTypeException('$capability', $capability, 'string');
51
-        }
52
-        if ( ! is_string($context)) {
53
-            throw new InvalidDataTypeException('$context', $context, 'string');
54
-        }
55
-        $this->capability = $capability;
56
-        $this->context = strtolower(str_replace(' ', '_', $context));
57
-        $this->ID = $ID;
58
-    }
59
-
60
-
61
-
62
-    /**
63
-     * @return string|array
64
-     */
65
-    public function capability()
66
-    {
67
-        return $this->capability;
68
-    }
69
-
70
-
71
-
72
-    /**
73
-     * @return string
74
-     */
75
-    public function context()
76
-    {
77
-        return $this->context;
78
-    }
79
-
80
-
81
-
82
-    /**
83
-     * @return int|string
84
-     */
85
-    public function ID()
86
-    {
87
-        return $this->ID;
88
-    }
23
+	/**
24
+	 * @var string|array $capability
25
+	 */
26
+	private $capability;
27
+
28
+	/**
29
+	 * @var string $context
30
+	 */
31
+	private $context;
32
+
33
+	/**
34
+	 * @var int|string $ID
35
+	 */
36
+	private $ID;
37
+
38
+
39
+
40
+	/**
41
+	 * @param string|array $capability   - the capability to be checked, like: 'ee_edit_registrations',
42
+	 *                                   or an array of capability strings
43
+	 * @param string       $context      - what the user is attempting to do, like: 'Edit Registration'
44
+	 * @param int          $ID           - (optional) ID for item where current_user_can is being called from
45
+	 * @throws InvalidDataTypeException
46
+	 */
47
+	public function __construct($capability, $context, $ID = 0)
48
+	{
49
+		if ( ! is_string($capability)) {
50
+			throw new InvalidDataTypeException('$capability', $capability, 'string');
51
+		}
52
+		if ( ! is_string($context)) {
53
+			throw new InvalidDataTypeException('$context', $context, 'string');
54
+		}
55
+		$this->capability = $capability;
56
+		$this->context = strtolower(str_replace(' ', '_', $context));
57
+		$this->ID = $ID;
58
+	}
59
+
60
+
61
+
62
+	/**
63
+	 * @return string|array
64
+	 */
65
+	public function capability()
66
+	{
67
+		return $this->capability;
68
+	}
69
+
70
+
71
+
72
+	/**
73
+	 * @return string
74
+	 */
75
+	public function context()
76
+	{
77
+		return $this->context;
78
+	}
79
+
80
+
81
+
82
+	/**
83
+	 * @return int|string
84
+	 */
85
+	public function ID()
86
+	{
87
+		return $this->ID;
88
+	}
89 89
 
90 90
 
91 91
 }
Please login to merge, or discard this patch.
core/admin/EE_Admin.core.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
 
168 168
 
169 169
 	/**
170
-	* init- should fire after shortcode, module,  addon, other plugin (default priority), and even EE_Front_Controller's init phases have run
171
-	*
172
-	* @access public
173
-	* @return void
174
-	*/
170
+	 * init- should fire after shortcode, module,  addon, other plugin (default priority), and even EE_Front_Controller's init phases have run
171
+	 *
172
+	 * @access public
173
+	 * @return void
174
+	 */
175 175
 	public function init() {
176 176
 		//only enable most of the EE_Admin IF we're not in full maintenance mode
177 177
 		if ( EE_Maintenance_Mode::instance()->models_can_query() ){
@@ -456,11 +456,11 @@  discard block
 block discarded – undo
456 456
 
457 457
 
458 458
 	/**
459
-	* admin_init
460
-	*
461
-	* @access public
462
-	* @return void
463
-	*/
459
+	 * admin_init
460
+	 *
461
+	 * @access public
462
+	 * @return void
463
+	 */
464 464
 	public function admin_init() {
465 465
 
466 466
 		/**
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
 
479 479
 		/**
480 480
 		 * This code excludes EE critical pages anywhere `wp_dropdown_pages` is used to create a dropdown for selecting
481
-         * critical pages.  The only place critical pages need included in a generated dropdown is on the "Critical Pages"
482
-         * tab in the EE General Settings Admin page.
483
-         * This is for user-proofing.
481
+		 * critical pages.  The only place critical pages need included in a generated dropdown is on the "Critical Pages"
482
+		 * tab in the EE General Settings Admin page.
483
+		 * This is for user-proofing.
484 484
 		 */
485
-        add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
485
+		add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
486 486
 
487 487
 	}
488 488
 
@@ -611,24 +611,24 @@  discard block
 block discarded – undo
611 611
 
612 612
 
613 613
 	/**
614
-	* 	dismiss_persistent_admin_notice
615
-	*
616
-	*	@access 	public
617
-	* 	@return 		void
618
-	*/
614
+	 * 	dismiss_persistent_admin_notice
615
+	 *
616
+	 *	@access 	public
617
+	 * 	@return 		void
618
+	 */
619 619
 	public function dismiss_ee_nag_notice_callback() {
620 620
 		EE_Error::dismiss_persistent_admin_notice();
621 621
 	}
622 622
 
623 623
 
624 624
 
625
-    /**
626
-     * @param array $elements
627
-     * @return array
628
-     * @throws \EE_Error
629
-     */
625
+	/**
626
+	 * @param array $elements
627
+	 * @return array
628
+	 * @throws \EE_Error
629
+	 */
630 630
 	public function dashboard_glance_items($elements) {
631
-        $elements = is_array($elements) ? $elements : array($elements);
631
+		$elements = is_array($elements) ? $elements : array($elements);
632 632
 		$events = EEM_Event::instance()->count();
633 633
 		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_events'), admin_url('admin.php') );
634 634
 		$items['events']['text'] = sprintf( _n( '%s Event', '%s Events', $events ), number_format_i18n( $events ) );
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.
Spacing   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public static function instance() {
42 42
 		// check if class object is instantiated
43
-		if (  ! self::$_instance instanceof EE_Admin ) {
43
+		if ( ! self::$_instance instanceof EE_Admin) {
44 44
 			self::$_instance = new self();
45 45
 		}
46 46
 		return self::$_instance;
@@ -57,25 +57,25 @@  discard block
 block discarded – undo
57 57
 		// define global EE_Admin constants
58 58
 		$this->_define_all_constants();
59 59
 		// set autoloaders for our admin page classes based on included path information
60
-		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( EE_ADMIN );
60
+		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder(EE_ADMIN);
61 61
 		// admin hooks
62
-		add_filter( 'plugin_action_links', array( $this, 'filter_plugin_actions' ), 10, 2 );
62
+		add_filter('plugin_action_links', array($this, 'filter_plugin_actions'), 10, 2);
63 63
 		// load EE_Request_Handler early
64
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'get_request' ));
65
-		add_action( 'AHEE__EE_System__initialize_last', array( $this, 'init' ));
66
-		add_action( 'AHEE__EE_Admin_Page__route_admin_request', array( $this, 'route_admin_request' ), 100, 2 );
67
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ), 100 );
68
-		add_action( 'admin_init', array( $this, 'admin_init' ), 100 );
69
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 20 );
70
-		add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 10 );
71
-		add_action( 'network_admin_notices', array( $this, 'display_admin_notices' ), 10 );
72
-		add_filter( 'pre_update_option', array( $this, 'check_for_invalid_datetime_formats' ), 100, 2 );
73
-		add_filter('admin_footer_text', array( $this, 'espresso_admin_footer' ));
64
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'get_request'));
65
+		add_action('AHEE__EE_System__initialize_last', array($this, 'init'));
66
+		add_action('AHEE__EE_Admin_Page__route_admin_request', array($this, 'route_admin_request'), 100, 2);
67
+		add_action('wp_loaded', array($this, 'wp_loaded'), 100);
68
+		add_action('admin_init', array($this, 'admin_init'), 100);
69
+		add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'), 20);
70
+		add_action('admin_notices', array($this, 'display_admin_notices'), 10);
71
+		add_action('network_admin_notices', array($this, 'display_admin_notices'), 10);
72
+		add_filter('pre_update_option', array($this, 'check_for_invalid_datetime_formats'), 100, 2);
73
+		add_filter('admin_footer_text', array($this, 'espresso_admin_footer'));
74 74
 
75 75
 		//reset Environment config (we only do this on admin page loads);
76 76
 		EE_Registry::instance()->CFG->environment->recheck_values();
77 77
 
78
-		do_action( 'AHEE__EE_Admin__loaded' );
78
+		do_action('AHEE__EE_Admin__loaded');
79 79
 	}
80 80
 
81 81
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 	 * @return void
91 91
 	 */
92 92
 	private function _define_all_constants() {
93
-		define( 'EE_ADMIN_URL', EE_PLUGIN_DIR_URL . 'core/admin/' );
94
-		define( 'EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL . 'admin_pages/' );
95
-		define( 'EE_ADMIN_TEMPLATE', EE_ADMIN . 'templates' . DS );
96
-		define( 'WP_ADMIN_PATH', ABSPATH . 'wp-admin/' );
97
-		define( 'WP_AJAX_URL', admin_url( 'admin-ajax.php' ));
93
+		define('EE_ADMIN_URL', EE_PLUGIN_DIR_URL.'core/admin/');
94
+		define('EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL.'admin_pages/');
95
+		define('EE_ADMIN_TEMPLATE', EE_ADMIN.'templates'.DS);
96
+		define('WP_ADMIN_PATH', ABSPATH.'wp-admin/');
97
+		define('WP_AJAX_URL', admin_url('admin-ajax.php'));
98 98
 	}
99 99
 
100 100
 
@@ -107,23 +107,23 @@  discard block
 block discarded – undo
107 107
 	 * @param 	string 	$plugin
108 108
 	 * @return 	array
109 109
 	 */
110
-	public function filter_plugin_actions( $links, $plugin ) {
110
+	public function filter_plugin_actions($links, $plugin) {
111 111
 		// set $main_file in stone
112 112
 		static $main_file;
113 113
 		// if $main_file is not set yet
114
-		if ( ! $main_file ) {
115
-			$main_file = plugin_basename( EVENT_ESPRESSO_MAIN_FILE );
114
+		if ( ! $main_file) {
115
+			$main_file = plugin_basename(EVENT_ESPRESSO_MAIN_FILE);
116 116
 		}
117
-		 if ( $plugin === $main_file ) {
117
+		 if ($plugin === $main_file) {
118 118
 		 	// compare current plugin to this one
119
-			if ( EE_Maintenance_Mode::instance()->level() === EE_Maintenance_Mode::level_2_complete_maintenance ) {
120
-				$maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode.  Click this link to learn why.">' . __('Maintenance Mode Active', 'event_espresso' ) . '</a>';
121
-				array_unshift( $links, $maintenance_link );
119
+			if (EE_Maintenance_Mode::instance()->level() === EE_Maintenance_Mode::level_2_complete_maintenance) {
120
+				$maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode.  Click this link to learn why.">'.__('Maintenance Mode Active', 'event_espresso').'</a>';
121
+				array_unshift($links, $maintenance_link);
122 122
 			} else {
123
-				$org_settings_link = '<a href="admin.php?page=espresso_general_settings">' . __( 'Settings', 'event_espresso' ) . '</a>';
124
-				$events_link = '<a href="admin.php?page=espresso_events">' . __( 'Events', 'event_espresso' ) . '</a>';
123
+				$org_settings_link = '<a href="admin.php?page=espresso_general_settings">'.__('Settings', 'event_espresso').'</a>';
124
+				$events_link = '<a href="admin.php?page=espresso_events">'.__('Events', 'event_espresso').'</a>';
125 125
 				// add before other links
126
-				array_unshift( $links, $org_settings_link, $events_link );
126
+				array_unshift($links, $org_settings_link, $events_link);
127 127
 			}
128 128
 		}
129 129
 		return $links;
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	 *	@return void
139 139
 	 */
140 140
 	public function get_request() {
141
-		EE_Registry::instance()->load_core( 'Request_Handler' );
142
-		EE_Registry::instance()->load_core( 'CPT_Strategy' );
141
+		EE_Registry::instance()->load_core('Request_Handler');
142
+		EE_Registry::instance()->load_core('CPT_Strategy');
143 143
 	}
144 144
 
145 145
 
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
 	 * @param array $admin_page_folder_names
152 152
 	 * @return array
153 153
 	 */
154
-	public function hide_admin_pages_except_maintenance_mode( $admin_page_folder_names = array() ){
154
+	public function hide_admin_pages_except_maintenance_mode($admin_page_folder_names = array()) {
155 155
 		return array(
156
-			'maintenance' => EE_ADMIN_PAGES . 'maintenance' . DS,
157
-			'about' => EE_ADMIN_PAGES . 'about' . DS,
158
-			'support' => EE_ADMIN_PAGES . 'support' . DS
156
+			'maintenance' => EE_ADMIN_PAGES.'maintenance'.DS,
157
+			'about' => EE_ADMIN_PAGES.'about'.DS,
158
+			'support' => EE_ADMIN_PAGES.'support'.DS
159 159
 		);
160 160
 	}
161 161
 
@@ -169,31 +169,31 @@  discard block
 block discarded – undo
169 169
 	*/
170 170
 	public function init() {
171 171
 		//only enable most of the EE_Admin IF we're not in full maintenance mode
172
-		if ( EE_Maintenance_Mode::instance()->models_can_query() ){
172
+		if (EE_Maintenance_Mode::instance()->models_can_query()) {
173 173
 			//ok so we want to enable the entire admin
174
-			add_action( 'wp_ajax_dismiss_ee_nag_notice', array( $this, 'dismiss_ee_nag_notice_callback' ));
175
-			add_action( 'admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 );
176
-			add_action( 'network_admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 );
174
+			add_action('wp_ajax_dismiss_ee_nag_notice', array($this, 'dismiss_ee_nag_notice_callback'));
175
+			add_action('admin_notices', array($this, 'get_persistent_admin_notices'), 9);
176
+			add_action('network_admin_notices', array($this, 'get_persistent_admin_notices'), 9);
177 177
 			//at a glance dashboard widget
178
-			add_filter( 'dashboard_glance_items', array( $this, 'dashboard_glance_items' ), 10 );
178
+			add_filter('dashboard_glance_items', array($this, 'dashboard_glance_items'), 10);
179 179
 			//filter for get_edit_post_link used on comments for custom post types
180
-			add_filter( 'get_edit_post_link', array( $this, 'modify_edit_post_link' ), 10, 2 );
180
+			add_filter('get_edit_post_link', array($this, 'modify_edit_post_link'), 10, 2);
181 181
 		}
182 182
 		// run the admin page factory but ONLY if we are doing an ee admin ajax request
183
-		if ( !defined('DOING_AJAX') || EE_ADMIN_AJAX ) {
183
+		if ( ! defined('DOING_AJAX') || EE_ADMIN_AJAX) {
184 184
 			try {
185 185
 				//this loads the controller for the admin pages which will setup routing etc
186
-				EE_Registry::instance()->load_core( 'Admin_Page_Loader' );
187
-			} catch ( EE_Error $e ) {
186
+				EE_Registry::instance()->load_core('Admin_Page_Loader');
187
+			} catch (EE_Error $e) {
188 188
 				$e->get_error();
189 189
 			}
190 190
 		}
191
-		add_filter( 'content_save_pre', array( $this, 'its_eSpresso' ), 10, 1 );
191
+		add_filter('content_save_pre', array($this, 'its_eSpresso'), 10, 1);
192 192
 		//make sure our CPTs and custom taxonomy metaboxes get shown for first time users
193
-		add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes' ), 10 );
194
-		add_action('admin_head', array( $this, 'register_custom_nav_menu_boxes' ), 10 );
193
+		add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes'), 10);
194
+		add_action('admin_head', array($this, 'register_custom_nav_menu_boxes'), 10);
195 195
 		//exclude EE critical pages from all nav menus and wp_list_pages
196
-		add_filter('nav_menu_meta_box_object', array( $this, 'remove_pages_from_nav_menu'), 10 );
196
+		add_filter('nav_menu_meta_box_object', array($this, 'remove_pages_from_nav_menu'), 10);
197 197
 	}
198 198
 
199 199
 
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
 	 * @param  object $post_type WP post type object
207 207
 	 * @return object            WP post type object
208 208
 	 */
209
-	public function remove_pages_from_nav_menu( $post_type ) {
209
+	public function remove_pages_from_nav_menu($post_type) {
210 210
 		//if this isn't the "pages" post type let's get out
211
-		if ( $post_type->name !== 'page' ) {
211
+		if ($post_type->name !== 'page') {
212 212
 			return $post_type;
213 213
 		}
214 214
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
@@ -228,28 +228,28 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	public function enable_hidden_ee_nav_menu_metaboxes() {
230 230
 		global $wp_meta_boxes, $pagenow;
231
-		if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php' ) {
231
+		if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php') {
232 232
 			return;
233 233
 		}
234 234
 		$user = wp_get_current_user();
235 235
 		//has this been done yet?
236
-		if ( get_user_option( 'ee_nav_menu_initialized', $user->ID ) ) {
236
+		if (get_user_option('ee_nav_menu_initialized', $user->ID)) {
237 237
 			return;
238 238
 		}
239 239
 
240
-		$hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus', $user->ID );
241
-		$initial_meta_boxes = apply_filters( 'FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page' ) );
240
+		$hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus', $user->ID);
241
+		$initial_meta_boxes = apply_filters('FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array('nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page'));
242 242
 
243
-		if ( is_array( $hidden_meta_boxes ) ) {
244
-			foreach ( $hidden_meta_boxes as $key => $meta_box_id ) {
245
-				if ( in_array( $meta_box_id, $initial_meta_boxes ) ) {
246
-					unset( $hidden_meta_boxes[ $key ] );
243
+		if (is_array($hidden_meta_boxes)) {
244
+			foreach ($hidden_meta_boxes as $key => $meta_box_id) {
245
+				if (in_array($meta_box_id, $initial_meta_boxes)) {
246
+					unset($hidden_meta_boxes[$key]);
247 247
 				}
248 248
 			}
249 249
 		}
250 250
 
251
-		update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
252
-		update_user_option( $user->ID, 'ee_nav_menu_initialized', 1, true );
251
+		update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true);
252
+		update_user_option($user->ID, 'ee_nav_menu_initialized', 1, true);
253 253
 	}
254 254
 
255 255
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 * @return void
269 269
 	 */
270 270
 	public function register_custom_nav_menu_boxes() {
271
-		add_meta_box( 'add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array( $this, 'ee_cpt_archive_pages' ), 'nav-menus', 'side', 'core' );
271
+		add_meta_box('add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array($this, 'ee_cpt_archive_pages'), 'nav-menus', 'side', 'core');
272 272
 	}
273 273
 
274 274
 
@@ -284,16 +284,16 @@  discard block
 block discarded – undo
284 284
 	 *
285 285
 	 * @return string  the (maybe) modified link
286 286
 	 */
287
-	public function modify_edit_post_link( $link, $id ) {
288
-		if ( ! $post = get_post( $id ) ){
287
+	public function modify_edit_post_link($link, $id) {
288
+		if ( ! $post = get_post($id)) {
289 289
 			return $link;
290 290
 		}
291
-		if ( $post->post_type === 'espresso_attendees' ) {
291
+		if ($post->post_type === 'espresso_attendees') {
292 292
 			$query_args = array(
293 293
 				'action' => 'edit_attendee',
294 294
 				'post' => $id
295 295
 			);
296
-			return EEH_URL::add_query_args_and_nonce( $query_args, admin_url('admin.php?page=espresso_registrations') );
296
+			return EEH_URL::add_query_args_and_nonce($query_args, admin_url('admin.php?page=espresso_registrations'));
297 297
 		}
298 298
 		return $link;
299 299
 	}
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		global $nav_menu_selected_id;
306 306
 
307 307
 		$db_fields = false;
308
-		$walker = new Walker_Nav_Menu_Checklist( $db_fields );
308
+		$walker = new Walker_Nav_Menu_Checklist($db_fields);
309 309
 		$current_tab = 'event-archives';
310 310
 
311 311
 		/*if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
 		?>
325 325
 		<div id="posttype-extra-nav-menu-pages" class="posttypediv">
326 326
 			<ul id="posttype-extra-nav-menu-pages-tabs" class="posttype-tabs add-menu-item-tabs">
327
-				<li <?php echo ( 'event-archives' === $current_tab ? ' class="tabs"' : '' ); ?>>
328
-					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ( $nav_menu_selected_id ) {echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args)));} ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
329
-						<?php _e( 'Event Archive Pages', 'event_espresso' ); ?>
327
+				<li <?php echo ('event-archives' === $current_tab ? ' class="tabs"' : ''); ?>>
328
+					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ($nav_menu_selected_id) {echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args))); } ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
329
+						<?php _e('Event Archive Pages', 'event_espresso'); ?>
330 330
 					</a>
331 331
 				</li>
332 332
 			<?php /* // temporarily removing but leaving skeleton in place in case we ever decide to add more tabs.
@@ -344,13 +344,13 @@  discard block
 block discarded – undo
344 344
  			<?php */ ?>
345 345
 
346 346
 			<div id="tabs-panel-posttype-extra-nav-menu-pages-event-archives" class="tabs-panel <?php
347
-			echo ( 'event-archives' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
347
+			echo ('event-archives' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive');
348 348
 			?>">
349 349
 				<ul id="extra-nav-menu-pageschecklist-event-archives" class="categorychecklist form-no-clear">
350 350
 					<?php
351 351
 					$pages = $this->_get_extra_nav_menu_pages_items();
352 352
 					$args['walker'] = $walker;
353
-					echo walk_nav_menu_tree( array_map( array( $this, '_setup_extra_nav_menu_pages_items' ), $pages), 0, (object) $args );
353
+					echo walk_nav_menu_tree(array_map(array($this, '_setup_extra_nav_menu_pages_items'), $pages), 0, (object) $args);
354 354
 					?>
355 355
 				</ul>
356 356
 			</div><!-- /.tabs-panel -->
@@ -358,18 +358,18 @@  discard block
 block discarded – undo
358 358
 			<p class="button-controls">
359 359
 				<span class="list-controls">
360 360
 					<a href="<?php
361
-						echo esc_url( add_query_arg(
361
+						echo esc_url(add_query_arg(
362 362
 							array(
363 363
 								'extra-nav-menu-pages-tab' => 'event-archives',
364 364
 								'selectall' => 1,
365 365
 							),
366
-							remove_query_arg( $removed_args )
366
+							remove_query_arg($removed_args)
367 367
 						));
368 368
 					?>#posttype-extra-nav-menu-pages>" class="select-all"><?php _e('Select All'); ?></a>
369 369
 				</span>
370 370
 
371 371
 				<span class="add-to-menu">
372
-					<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-extra-nav-menu-pages' ); ?>" />
372
+					<input type="submit"<?php wp_nav_menu_disabled_check($nav_menu_selected_id); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e(__('Add to Menu')); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e('submit-posttype-extra-nav-menu-pages'); ?>" />
373 373
 					<span class="spinner"></span>
374 374
 				</span>
375 375
 			</p>
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
 	private function _get_extra_nav_menu_pages_items() {
391 391
 		$menuitems[] = array(
392 392
 			'title' => __('Event List', 'event_espresso'),
393
-			'url' => get_post_type_archive_link( 'espresso_events' ),
393
+			'url' => get_post_type_archive_link('espresso_events'),
394 394
 			'description' => __('Archive page for all events.', 'event_espresso')
395 395
 		);
396
-		return apply_filters( 'FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems );
396
+		return apply_filters('FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems);
397 397
 	}
398 398
 
399 399
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	 * @param $menu_item_values
406 406
 	 * @return stdClass
407 407
 	 */
408
-	private function _setup_extra_nav_menu_pages_items( $menu_item_values ) {
408
+	private function _setup_extra_nav_menu_pages_items($menu_item_values) {
409 409
 		$menu_item = new stdClass();
410 410
 		$keys = array(
411 411
 			'ID' => 0,
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
 			'xfn' => ''
426 426
 		);
427 427
 
428
-		foreach ( $keys as $key => $value) {
429
-			$menu_item->{$key} = isset( $menu_item_values[ $key]) ? $menu_item_values[ $key] : $value;
428
+		foreach ($keys as $key => $value) {
429
+			$menu_item->{$key} = isset($menu_item_values[$key]) ? $menu_item_values[$key] : $value;
430 430
 		}
431 431
 		return $menu_item;
432 432
 	}
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
 		 * - check if doing post processing of one of EE CPTs
466 466
 		 * - instantiate the corresponding EE CPT model for the post_type being processed.
467 467
 		 */
468
-		if ( isset( $_POST['action'], $_POST['post_type'] ) && $_POST['action'] === 'editpost' ) {
469
-			EE_Registry::instance()->load_core( 'Register_CPTs' );
470
-			EE_Register_CPTs::instantiate_cpt_models( $_POST['post_type'] );
468
+		if (isset($_POST['action'], $_POST['post_type']) && $_POST['action'] === 'editpost') {
469
+			EE_Registry::instance()->load_core('Register_CPTs');
470
+			EE_Register_CPTs::instantiate_cpt_models($_POST['post_type']);
471 471
 		}
472 472
 
473 473
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
          * tab in the EE General Settings Admin page.
478 478
          * This is for user-proofing.
479 479
 		 */
480
-        add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
480
+        add_filter('wp_dropdown_pages', array($this, 'modify_dropdown_pages'));
481 481
 
482 482
 	}
483 483
 
@@ -488,25 +488,25 @@  discard block
 block discarded – undo
488 488
 	 * @param string $output  Current output.
489 489
 	 * @return string
490 490
 	 */
491
-	public function modify_dropdown_pages( $output ) {
491
+	public function modify_dropdown_pages($output) {
492 492
 		//get critical pages
493 493
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
494 494
 
495 495
 		//split current output by line break for easier parsing.
496
-		$split_output = explode( "\n", $output );
496
+		$split_output = explode("\n", $output);
497 497
 
498 498
 		//loop through to remove any critical pages from the array.
499
-		foreach ( $critical_pages as $page_id ) {
500
-			$needle = 'value="' . $page_id . '"';
501
-			foreach( $split_output as $key => $haystack ) {
502
-				if( strpos( $haystack, $needle ) !== false ) {
503
-					unset( $split_output[$key] );
499
+		foreach ($critical_pages as $page_id) {
500
+			$needle = 'value="'.$page_id.'"';
501
+			foreach ($split_output as $key => $haystack) {
502
+				if (strpos($haystack, $needle) !== false) {
503
+					unset($split_output[$key]);
504 504
 				}
505 505
 			}
506 506
 		}
507 507
 
508 508
 		//replace output with the new contents
509
-		return implode( "\n", $split_output );
509
+		return implode("\n", $split_output);
510 510
 	}
511 511
 
512 512
 
@@ -520,17 +520,17 @@  discard block
 block discarded – undo
520 520
 	public function enqueue_admin_scripts() {
521 521
 		// this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js.
522 522
 		// Note: the intention of this script is to only do TARGETED injections.  I.E, only injecting on certain script calls.
523
-		wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
523
+		wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL.'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
524 524
 		// register cookie script for future dependencies
525
-		wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL . 'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE );
525
+		wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL.'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE);
526 526
 		//joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again vai: add_filter('FHEE_load_joyride', '__return_true' );
527
-		if ( apply_filters( 'FHEE_load_joyride', FALSE ) ) {
527
+		if (apply_filters('FHEE_load_joyride', FALSE)) {
528 528
 			//joyride style
529
-			wp_register_style('joyride-css', EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', array(), '2.1');
530
-			wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION );
531
-			wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', array(), '2.1', TRUE );
529
+			wp_register_style('joyride-css', EE_THIRD_PARTY_URL.'joyride/joyride-2.1.css', array(), '2.1');
530
+			wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL.'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION);
531
+			wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL.'joyride/modernizr.mq.js', array(), '2.1', TRUE);
532 532
 			//joyride JS
533
-			wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE );
533
+			wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL.'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE);
534 534
 			// wanna go for a joyride?
535 535
 			wp_enqueue_style('ee-joyride-css');
536 536
 			wp_enqueue_script('jquery-joyride');
@@ -560,11 +560,11 @@  discard block
 block discarded – undo
560 560
 	public function get_persistent_admin_notices() {
561 561
 		// http://www.example.com/wp-admin/admin.php?page=espresso_general_settings&action=critical_pages&critical_pages_nonce=2831ce0f30
562 562
 		$args = array(
563
-			'page' => EE_Registry::instance()->REQ->is_set( 'page' ) ? EE_Registry::instance()->REQ->get( 'page' ) : '',
564
-			'action' => EE_Registry::instance()->REQ->is_set( 'action' ) ? EE_Registry::instance()->REQ->get( 'action' ) : '',
563
+			'page' => EE_Registry::instance()->REQ->is_set('page') ? EE_Registry::instance()->REQ->get('page') : '',
564
+			'action' => EE_Registry::instance()->REQ->is_set('action') ? EE_Registry::instance()->REQ->get('action') : '',
565 565
 		);
566
-		$return_url = EE_Admin_Page::add_query_args_and_nonce( $args, EE_ADMIN_URL );
567
-		echo EE_Error::get_persistent_admin_notices( $return_url );
566
+		$return_url = EE_Admin_Page::add_query_args_and_nonce($args, EE_ADMIN_URL);
567
+		echo EE_Error::get_persistent_admin_notices($return_url);
568 568
 	}
569 569
 
570 570
 
@@ -589,24 +589,24 @@  discard block
 block discarded – undo
589 589
 	public function dashboard_glance_items($elements) {
590 590
         $elements = is_array($elements) ? $elements : array($elements);
591 591
 		$events = EEM_Event::instance()->count();
592
-		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_events'), admin_url('admin.php') );
593
-		$items['events']['text'] = sprintf( _n( '%s Event', '%s Events', $events ), number_format_i18n( $events ) );
592
+		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events'), admin_url('admin.php'));
593
+		$items['events']['text'] = sprintf(_n('%s Event', '%s Events', $events), number_format_i18n($events));
594 594
 		$items['events']['title'] = __('Click to view all Events', 'event_espresso');
595 595
 		$registrations = EEM_Registration::instance()->count(
596 596
 			array(
597 597
 				array(
598
-					'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete )
598
+					'STS_ID' => array('!=', EEM_Registration::status_id_incomplete)
599 599
 				)
600 600
 			)
601 601
 		);
602
-		$items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_registrations' ), admin_url('admin.php') );
603
-		$items['registrations']['text'] = sprintf( _n( '%s Registration', '%s Registrations', $registrations ), number_format_i18n($registrations) );
602
+		$items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_registrations'), admin_url('admin.php'));
603
+		$items['registrations']['text'] = sprintf(_n('%s Registration', '%s Registrations', $registrations), number_format_i18n($registrations));
604 604
 		$items['registrations']['title'] = __('Click to view all registrations', 'event_espresso');
605 605
 
606
-		$items = (array) apply_filters( 'FHEE__EE_Admin__dashboard_glance_items__items', $items );
606
+		$items = (array) apply_filters('FHEE__EE_Admin__dashboard_glance_items__items', $items);
607 607
 
608
-		foreach ( $items as $type => $item_properties ) {
609
-			$elements[] = sprintf( '<a class="ee-dashboard-link-' . $type . '" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text'] );
608
+		foreach ($items as $type => $item_properties) {
609
+			$elements[] = sprintf('<a class="ee-dashboard-link-'.$type.'" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text']);
610 610
 		}
611 611
 		return $elements;
612 612
 	}
@@ -623,31 +623,31 @@  discard block
 block discarded – undo
623 623
 	 * @throws EE_Error
624 624
 	 * @return    string
625 625
 	 */
626
-	public function check_for_invalid_datetime_formats( $value, $option ) {
626
+	public function check_for_invalid_datetime_formats($value, $option) {
627 627
 		// check for date_format or time_format
628
-		switch ( $option ) {
628
+		switch ($option) {
629 629
 			case 'date_format' :
630
-				$date_time_format = $value . ' ' . get_option('time_format');
630
+				$date_time_format = $value.' '.get_option('time_format');
631 631
 				break;
632 632
 			case 'time_format' :
633
-				$date_time_format = get_option('date_format') . ' ' . $value;
633
+				$date_time_format = get_option('date_format').' '.$value;
634 634
 				break;
635 635
 			default :
636 636
 				$date_time_format = FALSE;
637 637
 		}
638 638
 		// do we have a date_time format to check ?
639
-		if ( $date_time_format ) {
640
-			$error_msg = EEH_DTT_Helper::validate_format_string( $date_time_format );
639
+		if ($date_time_format) {
640
+			$error_msg = EEH_DTT_Helper::validate_format_string($date_time_format);
641 641
 
642
-			if ( is_array( $error_msg ) ) {
643
-				$msg = '<p>' . sprintf( __( 'The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso' ), date( $date_time_format ) , $date_time_format  ) . '</p><p><ul>';
642
+			if (is_array($error_msg)) {
643
+				$msg = '<p>'.sprintf(__('The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso'), date($date_time_format), $date_time_format).'</p><p><ul>';
644 644
 
645 645
 
646
-				foreach ( $error_msg as $error ) {
647
-					$msg .= '<li>' . $error . '</li>';
646
+				foreach ($error_msg as $error) {
647
+					$msg .= '<li>'.$error.'</li>';
648 648
 				}
649 649
 
650
-				$msg .= '</ul></p><p>' . sprintf( __( '%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso' ), '<span style="color:#D54E21;">', '</span>' ) . '</p>';
650
+				$msg .= '</ul></p><p>'.sprintf(__('%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso'), '<span style="color:#D54E21;">', '</span>').'</p>';
651 651
 
652 652
 				// trigger WP settings error
653 653
 				add_settings_error(
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 				);
658 658
 
659 659
 				// set format to something valid
660
-				switch ( $option ) {
660
+				switch ($option) {
661 661
 					case 'date_format' :
662 662
 						$value = 'F j, Y';
663 663
 						break;
@@ -679,8 +679,8 @@  discard block
 block discarded – undo
679 679
 	 * @param $content
680 680
 	 * @return    string
681 681
 	 */
682
-	public function its_eSpresso( $content ) {
683
-		return str_replace( '[EXPRESSO_', '[ESPRESSO_', $content );
682
+	public function its_eSpresso($content) {
683
+		return str_replace('[EXPRESSO_', '[ESPRESSO_', $content);
684 684
 	}
685 685
 
686 686
 
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 	 *  @return 	string
693 693
 	 */
694 694
 	public function espresso_admin_footer() {
695
-		return \EEH_Template::powered_by_event_espresso( 'aln-cntr', '', array( 'utm_content' => 'admin_footer' ));
695
+		return \EEH_Template::powered_by_event_espresso('aln-cntr', '', array('utm_content' => 'admin_footer'));
696 696
 	}
697 697
 
698 698
 
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
 	 * @param array $config
712 712
 	 * @return void
713 713
 	 */
714
-	public static function register_ee_admin_page( $page_basename, $page_path, $config = array() ) {
715
-		EE_Error::doing_it_wrong( __METHOD__, sprintf( __('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3' );
716
-		if ( class_exists( 'EE_Register_Admin_Page' ) ) {
714
+	public static function register_ee_admin_page($page_basename, $page_path, $config = array()) {
715
+		EE_Error::doing_it_wrong(__METHOD__, sprintf(__('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3');
716
+		if (class_exists('EE_Register_Admin_Page')) {
717 717
 			$config['page_path'] = $page_path;
718 718
 		}
719
-		EE_Register_Admin_Page::register( $page_basename, $config );
719
+		EE_Register_Admin_Page::register($page_basename, $config);
720 720
 
721 721
 	}
722 722
 
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 	 * @param  \WP_Post $post
730 730
 	 * @return void
731 731
 	 */
732
-	public static function parse_post_content_on_save( $post_ID, $post ) {
732
+	public static function parse_post_content_on_save($post_ID, $post) {
733 733
 		EE_Error::doing_it_wrong(
734 734
 			__METHOD__,
735 735
 			__('Usage is deprecated', 'event_espresso'),
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 	 * @param  $value
748 748
 	 * @return void
749 749
 	 */
750
-	public function reset_page_for_posts_on_change( $option, $old_value, $value ) {
750
+	public function reset_page_for_posts_on_change($option, $old_value, $value) {
751 751
 		EE_Error::doing_it_wrong(
752 752
 			__METHOD__,
753 753
 			__('Usage is deprecated', 'event_espresso'),
Please login to merge, or discard this patch.
core/libraries/iframe_display/Iframe.php 2 patches
Indentation   +306 added lines, -306 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\libraries\iframe_display;
3 3
 
4 4
 if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-    exit( 'No direct script access allowed' );
5
+	exit( 'No direct script access allowed' );
6 6
 }
7 7
 
8 8
 
@@ -18,338 +18,338 @@  discard block
 block discarded – undo
18 18
 class Iframe
19 19
 {
20 20
 
21
-    /*
21
+	/*
22 22
     * HTML for notices and ajax gif
23 23
     * @var string $title
24 24
     */
25
-    protected $title = '';
25
+	protected $title = '';
26 26
 
27
-    /*
27
+	/*
28 28
     * HTML for the content being displayed
29 29
     * @var string $content
30 30
     */
31
-    protected $content = '';
31
+	protected $content = '';
32 32
 
33
-    /*
33
+	/*
34 34
     * whether or not to call wp_head() and wp_footer()
35 35
     * @var boolean $enqueue_wp_assets
36 36
     */
37
-    protected $enqueue_wp_assets = false;
37
+	protected $enqueue_wp_assets = false;
38 38
 
39
-    /*
39
+	/*
40 40
     * an array of CSS URLs
41 41
     * @var array $css
42 42
     */
43
-    protected $css = array();
43
+	protected $css = array();
44 44
 
45
-    /*
45
+	/*
46 46
     * an array of JS URLs to be set in the HTML header.
47 47
     * @var array $header_js
48 48
     */
49
-    protected $header_js = array();
49
+	protected $header_js = array();
50 50
 
51
-    /*
51
+	/*
52 52
     * an array of JS URLs to be displayed before the HTML </body> tag
53 53
     * @var array $footer_js
54 54
     */
55
-    protected $footer_js = array();
55
+	protected $footer_js = array();
56 56
 
57
-    /*
57
+	/*
58 58
     * an array of JSON vars to be set in the HTML header.
59 59
     * @var array $localized_vars
60 60
     */
61
-    protected $localized_vars = array();
62
-
63
-
64
-
65
-    /**
66
-     * Iframe constructor
67
-     *
68
-     * @param string $title
69
-     * @param string $content
70
-     * @throws \DomainException
71
-     */
72
-    public function __construct( $title, $content )
73
-    {
74
-        global $wp_version;
75
-        if ( ! defined( 'EE_IFRAME_DIR_URL' ) ) {
76
-            define( 'EE_IFRAME_DIR_URL', plugin_dir_url( __FILE__ ) );
77
-        }
78
-        $this->setContent( $content );
79
-        $this->setTitle( $title );
80
-        $this->addStylesheets(
81
-            apply_filters(
82
-                'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_css',
83
-                array(
84
-                    'site_theme'       => get_stylesheet_directory_uri() . DS
85
-                                          . 'style.css?ver=' . EVENT_ESPRESSO_VERSION,
86
-                    'dashicons'        => includes_url( 'css/dashicons.min.css?ver=' . $wp_version ),
87
-                    'espresso_default' => EE_GLOBAL_ASSETS_URL
88
-                                          . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION,
89
-                ),
90
-                $this
91
-            )
92
-        );
93
-        $this->addScripts(
94
-            apply_filters(
95
-                'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_js',
96
-                array(
97
-                    'jquery'        => includes_url( 'js/jquery/jquery.js?ver=' . $wp_version ),
98
-                    'espresso_core' => EE_GLOBAL_ASSETS_URL
99
-                                       . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION,
100
-                ),
101
-                $this
102
-            )
103
-        );
104
-        if (
105
-            apply_filters(
106
-                'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__load_default_theme_stylesheet',
107
-                false
108
-            )
109
-        ) {
110
-            $this->addStylesheets(
111
-                apply_filters(
112
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_theme_stylesheet',
113
-                    array('default_theme_stylesheet' => get_stylesheet_uri()),
114
-                    $this
115
-                )
116
-            );
117
-        }
118
-    }
119
-
120
-
121
-
122
-    /**
123
-     * @param string $title
124
-     * @throws \DomainException
125
-     */
126
-    public function setTitle( $title )
127
-    {
128
-        if ( empty( $title ) ) {
129
-            throw new \DomainException(
130
-                esc_html__( 'You must provide a page title in order to create an iframe.', 'event_espresso' )
131
-            );
132
-        }
133
-        $this->title = $title;
134
-    }
135
-
136
-
137
-
138
-    /**
139
-     * @param string $content
140
-     * @throws \DomainException
141
-     */
142
-    public function setContent( $content )
143
-    {
144
-        if ( empty( $content ) ) {
145
-            throw new \DomainException(
146
-                esc_html__( 'You must provide content in order to create an iframe.', 'event_espresso' )
147
-            );
148
-        }
149
-        $this->content = $content;
150
-    }
151
-
152
-
153
-
154
-    /**
155
-     * @param boolean $enqueue_wp_assets
156
-     */
157
-    public function setEnqueueWpAssets( $enqueue_wp_assets )
158
-    {
159
-        $this->enqueue_wp_assets = filter_var( $enqueue_wp_assets, FILTER_VALIDATE_BOOLEAN );
160
-    }
161
-
162
-
163
-
164
-    /**
165
-     * @param array $stylesheets
166
-     * @throws \DomainException
167
-     */
168
-    public function addStylesheets( array $stylesheets )
169
-    {
170
-        if ( empty( $stylesheets ) ) {
171
-            throw new \DomainException(
172
-                esc_html__(
173
-                    'A non-empty array of URLs, is required to add a CSS stylesheet to an iframe.',
174
-                    'event_espresso'
175
-                )
176
-            );
177
-        }
178
-        foreach ( $stylesheets as $handle => $stylesheet ) {
179
-            $this->css[ $handle ] = $stylesheet;
180
-        }
181
-    }
182
-
183
-
184
-
185
-    /**
186
-     * @param array $scripts
187
-     * @param bool  $add_to_header
188
-     * @throws \DomainException
189
-     */
190
-    public function addScripts( array $scripts, $add_to_header = false )
191
-    {
192
-        if ( empty( $scripts ) ) {
193
-            throw new \DomainException(
194
-                esc_html__(
195
-                    'A non-empty array of URLs, is required to add Javascript to an iframe.',
196
-                    'event_espresso'
197
-                )
198
-            );
199
-        }
200
-        foreach ( $scripts as $handle => $script ) {
201
-            if ( $add_to_header ) {
202
-                $this->header_js[ $handle ] = $script;
203
-            } else {
204
-                $this->footer_js[ $handle ] = $script;
205
-            }
206
-        }
207
-    }
208
-
209
-
210
-
211
-    /**
212
-     * @param array  $vars
213
-     * @param string $var_name
214
-     * @throws \DomainException
215
-     */
216
-    public function addLocalizedVars( array $vars, $var_name = 'eei18n' )
217
-    {
218
-        if ( empty( $vars ) ) {
219
-            throw new \DomainException(
220
-                esc_html__(
221
-                    'A non-empty array of vars, is required to add localized Javascript vars to an iframe.',
222
-                    'event_espresso'
223
-                )
224
-            );
225
-        }
226
-        foreach ( $vars as $handle => $var ) {
227
-            if ( $var_name === 'eei18n' ) {
228
-                \EE_Registry::$i18n_js_strings[ $handle ] = $var;
229
-            } else {
230
-                if ( ! isset( $this->localized_vars[ $var_name ] ) ) {
231
-                    $this->localized_vars[ $var_name ] = array();
232
-                }
233
-                $this->localized_vars[ $var_name ][ $handle ] = $var;
234
-            }
235
-        }
236
-    }
237
-
238
-
239
-
240
-    /**
241
-     * @param string $utm_content
242
-     * @throws \DomainException
243
-     */
244
-    public function display($utm_content = '')
245
-    {
246
-        $this->content .= \EEH_Template::powered_by_event_espresso(
247
-            '',
248
-            '',
249
-            ! empty($utm_content) ? array('utm_content' => $utm_content) : array()
250
-        );
251
-        \EE_System::do_not_cache();
252
-        echo $this->getTemplate();
253
-        exit;
254
-    }
255
-
256
-
257
-
258
-    /**
259
-     * @return string
260
-     * @throws \DomainException
261
-     */
262
-    public function getTemplate()
263
-    {
264
-        return \EEH_Template::display_template(
265
-            __DIR__ . DIRECTORY_SEPARATOR . 'iframe_wrapper.template.php',
266
-            array(
267
-                'title'             => apply_filters(
268
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__title',
269
-                    $this->title,
270
-                    $this
271
-                ),
272
-                'content'           => apply_filters(
273
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__content',
274
-                    $this->content,
275
-                    $this
276
-                ),
277
-                'enqueue_wp_assets' => apply_filters(
278
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__enqueue_wp_assets',
279
-                    $this->enqueue_wp_assets,
280
-                    $this
281
-                ),
282
-                'css'               => (array)apply_filters(
283
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__css_urls',
284
-                    $this->css,
285
-                    $this
286
-                ),
287
-                'header_js'         => (array)apply_filters(
288
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__header_js_urls',
289
-                    $this->header_js,
290
-                    $this
291
-                ),
292
-                'footer_js'         => (array)apply_filters(
293
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__footer_js_urls',
294
-                    $this->footer_js,
295
-                    $this
296
-                ),
297
-                'eei18n'            => apply_filters(
298
-                    'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__eei18n_js_strings',
299
-                    \EE_Registry::localize_i18n_js_strings() . $this->localizeJsonVars(),
300
-                    $this
301
-                ),
302
-                'notices'           => \EEH_Template::display_template(
303
-                    EE_TEMPLATES . 'espresso-ajax-notices.template.php',
304
-                    array(),
305
-                    true
306
-                ),
307
-            ),
308
-            true,
309
-            true
310
-        );
311
-    }
312
-
313
-
314
-
315
-    /**
316
-     * localizeJsonVars
317
-     *
318
-     * @return string
319
-     */
320
-    public function localizeJsonVars()
321
-    {
322
-        $JSON = '';
323
-        foreach ( (array)$this->localized_vars as $var_name => $vars ) {
324
-            foreach ( (array)$vars as $key => $value ) {
325
-                $this->localized_vars[ $var_name ] = $this->encodeJsonVars( $value );
326
-            }
327
-            $JSON .= "/* <![CDATA[ */ var {$var_name} = ";
328
-            $JSON .= wp_json_encode( $this->localized_vars[ $var_name ] );
329
-            $JSON .= '; /* ]]> */';
330
-        }
331
-        return $JSON;
332
-    }
333
-
334
-
335
-
336
-    /**
337
-     * @param bool|int|float|string|array $var
338
-     * @return array
339
-     */
340
-    public function encodeJsonVars( $var )
341
-    {
342
-        if ( is_array( $var ) ) {
343
-            $localized_vars = array();
344
-            foreach ( (array)$var as $key => $value ) {
345
-                $localized_vars[ $key ] = $this->encodeJsonVars( $value );
346
-            }
347
-            return $localized_vars;
348
-        } else if ( is_scalar( $var ) ) {
349
-            return html_entity_decode( (string)$var, ENT_QUOTES, 'UTF-8' );
350
-        }
351
-        return null;
352
-    }
61
+	protected $localized_vars = array();
62
+
63
+
64
+
65
+	/**
66
+	 * Iframe constructor
67
+	 *
68
+	 * @param string $title
69
+	 * @param string $content
70
+	 * @throws \DomainException
71
+	 */
72
+	public function __construct( $title, $content )
73
+	{
74
+		global $wp_version;
75
+		if ( ! defined( 'EE_IFRAME_DIR_URL' ) ) {
76
+			define( 'EE_IFRAME_DIR_URL', plugin_dir_url( __FILE__ ) );
77
+		}
78
+		$this->setContent( $content );
79
+		$this->setTitle( $title );
80
+		$this->addStylesheets(
81
+			apply_filters(
82
+				'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_css',
83
+				array(
84
+					'site_theme'       => get_stylesheet_directory_uri() . DS
85
+										  . 'style.css?ver=' . EVENT_ESPRESSO_VERSION,
86
+					'dashicons'        => includes_url( 'css/dashicons.min.css?ver=' . $wp_version ),
87
+					'espresso_default' => EE_GLOBAL_ASSETS_URL
88
+										  . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION,
89
+				),
90
+				$this
91
+			)
92
+		);
93
+		$this->addScripts(
94
+			apply_filters(
95
+				'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_js',
96
+				array(
97
+					'jquery'        => includes_url( 'js/jquery/jquery.js?ver=' . $wp_version ),
98
+					'espresso_core' => EE_GLOBAL_ASSETS_URL
99
+									   . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION,
100
+				),
101
+				$this
102
+			)
103
+		);
104
+		if (
105
+			apply_filters(
106
+				'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__load_default_theme_stylesheet',
107
+				false
108
+			)
109
+		) {
110
+			$this->addStylesheets(
111
+				apply_filters(
112
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_theme_stylesheet',
113
+					array('default_theme_stylesheet' => get_stylesheet_uri()),
114
+					$this
115
+				)
116
+			);
117
+		}
118
+	}
119
+
120
+
121
+
122
+	/**
123
+	 * @param string $title
124
+	 * @throws \DomainException
125
+	 */
126
+	public function setTitle( $title )
127
+	{
128
+		if ( empty( $title ) ) {
129
+			throw new \DomainException(
130
+				esc_html__( 'You must provide a page title in order to create an iframe.', 'event_espresso' )
131
+			);
132
+		}
133
+		$this->title = $title;
134
+	}
135
+
136
+
137
+
138
+	/**
139
+	 * @param string $content
140
+	 * @throws \DomainException
141
+	 */
142
+	public function setContent( $content )
143
+	{
144
+		if ( empty( $content ) ) {
145
+			throw new \DomainException(
146
+				esc_html__( 'You must provide content in order to create an iframe.', 'event_espresso' )
147
+			);
148
+		}
149
+		$this->content = $content;
150
+	}
151
+
152
+
153
+
154
+	/**
155
+	 * @param boolean $enqueue_wp_assets
156
+	 */
157
+	public function setEnqueueWpAssets( $enqueue_wp_assets )
158
+	{
159
+		$this->enqueue_wp_assets = filter_var( $enqueue_wp_assets, FILTER_VALIDATE_BOOLEAN );
160
+	}
161
+
162
+
163
+
164
+	/**
165
+	 * @param array $stylesheets
166
+	 * @throws \DomainException
167
+	 */
168
+	public function addStylesheets( array $stylesheets )
169
+	{
170
+		if ( empty( $stylesheets ) ) {
171
+			throw new \DomainException(
172
+				esc_html__(
173
+					'A non-empty array of URLs, is required to add a CSS stylesheet to an iframe.',
174
+					'event_espresso'
175
+				)
176
+			);
177
+		}
178
+		foreach ( $stylesheets as $handle => $stylesheet ) {
179
+			$this->css[ $handle ] = $stylesheet;
180
+		}
181
+	}
182
+
183
+
184
+
185
+	/**
186
+	 * @param array $scripts
187
+	 * @param bool  $add_to_header
188
+	 * @throws \DomainException
189
+	 */
190
+	public function addScripts( array $scripts, $add_to_header = false )
191
+	{
192
+		if ( empty( $scripts ) ) {
193
+			throw new \DomainException(
194
+				esc_html__(
195
+					'A non-empty array of URLs, is required to add Javascript to an iframe.',
196
+					'event_espresso'
197
+				)
198
+			);
199
+		}
200
+		foreach ( $scripts as $handle => $script ) {
201
+			if ( $add_to_header ) {
202
+				$this->header_js[ $handle ] = $script;
203
+			} else {
204
+				$this->footer_js[ $handle ] = $script;
205
+			}
206
+		}
207
+	}
208
+
209
+
210
+
211
+	/**
212
+	 * @param array  $vars
213
+	 * @param string $var_name
214
+	 * @throws \DomainException
215
+	 */
216
+	public function addLocalizedVars( array $vars, $var_name = 'eei18n' )
217
+	{
218
+		if ( empty( $vars ) ) {
219
+			throw new \DomainException(
220
+				esc_html__(
221
+					'A non-empty array of vars, is required to add localized Javascript vars to an iframe.',
222
+					'event_espresso'
223
+				)
224
+			);
225
+		}
226
+		foreach ( $vars as $handle => $var ) {
227
+			if ( $var_name === 'eei18n' ) {
228
+				\EE_Registry::$i18n_js_strings[ $handle ] = $var;
229
+			} else {
230
+				if ( ! isset( $this->localized_vars[ $var_name ] ) ) {
231
+					$this->localized_vars[ $var_name ] = array();
232
+				}
233
+				$this->localized_vars[ $var_name ][ $handle ] = $var;
234
+			}
235
+		}
236
+	}
237
+
238
+
239
+
240
+	/**
241
+	 * @param string $utm_content
242
+	 * @throws \DomainException
243
+	 */
244
+	public function display($utm_content = '')
245
+	{
246
+		$this->content .= \EEH_Template::powered_by_event_espresso(
247
+			'',
248
+			'',
249
+			! empty($utm_content) ? array('utm_content' => $utm_content) : array()
250
+		);
251
+		\EE_System::do_not_cache();
252
+		echo $this->getTemplate();
253
+		exit;
254
+	}
255
+
256
+
257
+
258
+	/**
259
+	 * @return string
260
+	 * @throws \DomainException
261
+	 */
262
+	public function getTemplate()
263
+	{
264
+		return \EEH_Template::display_template(
265
+			__DIR__ . DIRECTORY_SEPARATOR . 'iframe_wrapper.template.php',
266
+			array(
267
+				'title'             => apply_filters(
268
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__title',
269
+					$this->title,
270
+					$this
271
+				),
272
+				'content'           => apply_filters(
273
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__content',
274
+					$this->content,
275
+					$this
276
+				),
277
+				'enqueue_wp_assets' => apply_filters(
278
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__enqueue_wp_assets',
279
+					$this->enqueue_wp_assets,
280
+					$this
281
+				),
282
+				'css'               => (array)apply_filters(
283
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__css_urls',
284
+					$this->css,
285
+					$this
286
+				),
287
+				'header_js'         => (array)apply_filters(
288
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__header_js_urls',
289
+					$this->header_js,
290
+					$this
291
+				),
292
+				'footer_js'         => (array)apply_filters(
293
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__footer_js_urls',
294
+					$this->footer_js,
295
+					$this
296
+				),
297
+				'eei18n'            => apply_filters(
298
+					'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__eei18n_js_strings',
299
+					\EE_Registry::localize_i18n_js_strings() . $this->localizeJsonVars(),
300
+					$this
301
+				),
302
+				'notices'           => \EEH_Template::display_template(
303
+					EE_TEMPLATES . 'espresso-ajax-notices.template.php',
304
+					array(),
305
+					true
306
+				),
307
+			),
308
+			true,
309
+			true
310
+		);
311
+	}
312
+
313
+
314
+
315
+	/**
316
+	 * localizeJsonVars
317
+	 *
318
+	 * @return string
319
+	 */
320
+	public function localizeJsonVars()
321
+	{
322
+		$JSON = '';
323
+		foreach ( (array)$this->localized_vars as $var_name => $vars ) {
324
+			foreach ( (array)$vars as $key => $value ) {
325
+				$this->localized_vars[ $var_name ] = $this->encodeJsonVars( $value );
326
+			}
327
+			$JSON .= "/* <![CDATA[ */ var {$var_name} = ";
328
+			$JSON .= wp_json_encode( $this->localized_vars[ $var_name ] );
329
+			$JSON .= '; /* ]]> */';
330
+		}
331
+		return $JSON;
332
+	}
333
+
334
+
335
+
336
+	/**
337
+	 * @param bool|int|float|string|array $var
338
+	 * @return array
339
+	 */
340
+	public function encodeJsonVars( $var )
341
+	{
342
+		if ( is_array( $var ) ) {
343
+			$localized_vars = array();
344
+			foreach ( (array)$var as $key => $value ) {
345
+				$localized_vars[ $key ] = $this->encodeJsonVars( $value );
346
+			}
347
+			return $localized_vars;
348
+		} else if ( is_scalar( $var ) ) {
349
+			return html_entity_decode( (string)$var, ENT_QUOTES, 'UTF-8' );
350
+		}
351
+		return null;
352
+	}
353 353
 
354 354
 
355 355
 
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\libraries\iframe_display;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-    exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+    exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -69,23 +69,23 @@  discard block
 block discarded – undo
69 69
      * @param string $content
70 70
      * @throws \DomainException
71 71
      */
72
-    public function __construct( $title, $content )
72
+    public function __construct($title, $content)
73 73
     {
74 74
         global $wp_version;
75
-        if ( ! defined( 'EE_IFRAME_DIR_URL' ) ) {
76
-            define( 'EE_IFRAME_DIR_URL', plugin_dir_url( __FILE__ ) );
75
+        if ( ! defined('EE_IFRAME_DIR_URL')) {
76
+            define('EE_IFRAME_DIR_URL', plugin_dir_url(__FILE__));
77 77
         }
78
-        $this->setContent( $content );
79
-        $this->setTitle( $title );
78
+        $this->setContent($content);
79
+        $this->setTitle($title);
80 80
         $this->addStylesheets(
81 81
             apply_filters(
82 82
                 'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_css',
83 83
                 array(
84
-                    'site_theme'       => get_stylesheet_directory_uri() . DS
85
-                                          . 'style.css?ver=' . EVENT_ESPRESSO_VERSION,
86
-                    'dashicons'        => includes_url( 'css/dashicons.min.css?ver=' . $wp_version ),
84
+                    'site_theme'       => get_stylesheet_directory_uri().DS
85
+                                          . 'style.css?ver='.EVENT_ESPRESSO_VERSION,
86
+                    'dashicons'        => includes_url('css/dashicons.min.css?ver='.$wp_version),
87 87
                     'espresso_default' => EE_GLOBAL_ASSETS_URL
88
-                                          . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION,
88
+                                          . 'css/espresso_default.css?ver='.EVENT_ESPRESSO_VERSION,
89 89
                 ),
90 90
                 $this
91 91
             )
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
             apply_filters(
95 95
                 'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__construct__default_js',
96 96
                 array(
97
-                    'jquery'        => includes_url( 'js/jquery/jquery.js?ver=' . $wp_version ),
97
+                    'jquery'        => includes_url('js/jquery/jquery.js?ver='.$wp_version),
98 98
                     'espresso_core' => EE_GLOBAL_ASSETS_URL
99
-                                       . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION,
99
+                                       . 'scripts/espresso_core.js?ver='.EVENT_ESPRESSO_VERSION,
100 100
                 ),
101 101
                 $this
102 102
             )
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
      * @param string $title
124 124
      * @throws \DomainException
125 125
      */
126
-    public function setTitle( $title )
126
+    public function setTitle($title)
127 127
     {
128
-        if ( empty( $title ) ) {
128
+        if (empty($title)) {
129 129
             throw new \DomainException(
130
-                esc_html__( 'You must provide a page title in order to create an iframe.', 'event_espresso' )
130
+                esc_html__('You must provide a page title in order to create an iframe.', 'event_espresso')
131 131
             );
132 132
         }
133 133
         $this->title = $title;
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
      * @param string $content
140 140
      * @throws \DomainException
141 141
      */
142
-    public function setContent( $content )
142
+    public function setContent($content)
143 143
     {
144
-        if ( empty( $content ) ) {
144
+        if (empty($content)) {
145 145
             throw new \DomainException(
146
-                esc_html__( 'You must provide content in order to create an iframe.', 'event_espresso' )
146
+                esc_html__('You must provide content in order to create an iframe.', 'event_espresso')
147 147
             );
148 148
         }
149 149
         $this->content = $content;
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
     /**
155 155
      * @param boolean $enqueue_wp_assets
156 156
      */
157
-    public function setEnqueueWpAssets( $enqueue_wp_assets )
157
+    public function setEnqueueWpAssets($enqueue_wp_assets)
158 158
     {
159
-        $this->enqueue_wp_assets = filter_var( $enqueue_wp_assets, FILTER_VALIDATE_BOOLEAN );
159
+        $this->enqueue_wp_assets = filter_var($enqueue_wp_assets, FILTER_VALIDATE_BOOLEAN);
160 160
     }
161 161
 
162 162
 
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
      * @param array $stylesheets
166 166
      * @throws \DomainException
167 167
      */
168
-    public function addStylesheets( array $stylesheets )
168
+    public function addStylesheets(array $stylesheets)
169 169
     {
170
-        if ( empty( $stylesheets ) ) {
170
+        if (empty($stylesheets)) {
171 171
             throw new \DomainException(
172 172
                 esc_html__(
173 173
                     'A non-empty array of URLs, is required to add a CSS stylesheet to an iframe.',
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
                 )
176 176
             );
177 177
         }
178
-        foreach ( $stylesheets as $handle => $stylesheet ) {
179
-            $this->css[ $handle ] = $stylesheet;
178
+        foreach ($stylesheets as $handle => $stylesheet) {
179
+            $this->css[$handle] = $stylesheet;
180 180
         }
181 181
     }
182 182
 
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
      * @param bool  $add_to_header
188 188
      * @throws \DomainException
189 189
      */
190
-    public function addScripts( array $scripts, $add_to_header = false )
190
+    public function addScripts(array $scripts, $add_to_header = false)
191 191
     {
192
-        if ( empty( $scripts ) ) {
192
+        if (empty($scripts)) {
193 193
             throw new \DomainException(
194 194
                 esc_html__(
195 195
                     'A non-empty array of URLs, is required to add Javascript to an iframe.',
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
                 )
198 198
             );
199 199
         }
200
-        foreach ( $scripts as $handle => $script ) {
201
-            if ( $add_to_header ) {
202
-                $this->header_js[ $handle ] = $script;
200
+        foreach ($scripts as $handle => $script) {
201
+            if ($add_to_header) {
202
+                $this->header_js[$handle] = $script;
203 203
             } else {
204
-                $this->footer_js[ $handle ] = $script;
204
+                $this->footer_js[$handle] = $script;
205 205
             }
206 206
         }
207 207
     }
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
      * @param string $var_name
214 214
      * @throws \DomainException
215 215
      */
216
-    public function addLocalizedVars( array $vars, $var_name = 'eei18n' )
216
+    public function addLocalizedVars(array $vars, $var_name = 'eei18n')
217 217
     {
218
-        if ( empty( $vars ) ) {
218
+        if (empty($vars)) {
219 219
             throw new \DomainException(
220 220
                 esc_html__(
221 221
                     'A non-empty array of vars, is required to add localized Javascript vars to an iframe.',
@@ -223,14 +223,14 @@  discard block
 block discarded – undo
223 223
                 )
224 224
             );
225 225
         }
226
-        foreach ( $vars as $handle => $var ) {
227
-            if ( $var_name === 'eei18n' ) {
228
-                \EE_Registry::$i18n_js_strings[ $handle ] = $var;
226
+        foreach ($vars as $handle => $var) {
227
+            if ($var_name === 'eei18n') {
228
+                \EE_Registry::$i18n_js_strings[$handle] = $var;
229 229
             } else {
230
-                if ( ! isset( $this->localized_vars[ $var_name ] ) ) {
231
-                    $this->localized_vars[ $var_name ] = array();
230
+                if ( ! isset($this->localized_vars[$var_name])) {
231
+                    $this->localized_vars[$var_name] = array();
232 232
                 }
233
-                $this->localized_vars[ $var_name ][ $handle ] = $var;
233
+                $this->localized_vars[$var_name][$handle] = $var;
234 234
             }
235 235
         }
236 236
     }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     public function getTemplate()
263 263
     {
264 264
         return \EEH_Template::display_template(
265
-            __DIR__ . DIRECTORY_SEPARATOR . 'iframe_wrapper.template.php',
265
+            __DIR__.DIRECTORY_SEPARATOR.'iframe_wrapper.template.php',
266 266
             array(
267 267
                 'title'             => apply_filters(
268 268
                     'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__title',
@@ -279,28 +279,28 @@  discard block
 block discarded – undo
279 279
                     $this->enqueue_wp_assets,
280 280
                     $this
281 281
                 ),
282
-                'css'               => (array)apply_filters(
282
+                'css'               => (array) apply_filters(
283 283
                     'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__css_urls',
284 284
                     $this->css,
285 285
                     $this
286 286
                 ),
287
-                'header_js'         => (array)apply_filters(
287
+                'header_js'         => (array) apply_filters(
288 288
                     'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__header_js_urls',
289 289
                     $this->header_js,
290 290
                     $this
291 291
                 ),
292
-                'footer_js'         => (array)apply_filters(
292
+                'footer_js'         => (array) apply_filters(
293 293
                     'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__footer_js_urls',
294 294
                     $this->footer_js,
295 295
                     $this
296 296
                 ),
297 297
                 'eei18n'            => apply_filters(
298 298
                     'FHEE___EventEspresso_core_libraries_iframe_display_Iframe__getTemplate__eei18n_js_strings',
299
-                    \EE_Registry::localize_i18n_js_strings() . $this->localizeJsonVars(),
299
+                    \EE_Registry::localize_i18n_js_strings().$this->localizeJsonVars(),
300 300
                     $this
301 301
                 ),
302 302
                 'notices'           => \EEH_Template::display_template(
303
-                    EE_TEMPLATES . 'espresso-ajax-notices.template.php',
303
+                    EE_TEMPLATES.'espresso-ajax-notices.template.php',
304 304
                     array(),
305 305
                     true
306 306
                 ),
@@ -320,12 +320,12 @@  discard block
 block discarded – undo
320 320
     public function localizeJsonVars()
321 321
     {
322 322
         $JSON = '';
323
-        foreach ( (array)$this->localized_vars as $var_name => $vars ) {
324
-            foreach ( (array)$vars as $key => $value ) {
325
-                $this->localized_vars[ $var_name ] = $this->encodeJsonVars( $value );
323
+        foreach ((array) $this->localized_vars as $var_name => $vars) {
324
+            foreach ((array) $vars as $key => $value) {
325
+                $this->localized_vars[$var_name] = $this->encodeJsonVars($value);
326 326
             }
327 327
             $JSON .= "/* <![CDATA[ */ var {$var_name} = ";
328
-            $JSON .= wp_json_encode( $this->localized_vars[ $var_name ] );
328
+            $JSON .= wp_json_encode($this->localized_vars[$var_name]);
329 329
             $JSON .= '; /* ]]> */';
330 330
         }
331 331
         return $JSON;
@@ -337,16 +337,16 @@  discard block
 block discarded – undo
337 337
      * @param bool|int|float|string|array $var
338 338
      * @return array
339 339
      */
340
-    public function encodeJsonVars( $var )
340
+    public function encodeJsonVars($var)
341 341
     {
342
-        if ( is_array( $var ) ) {
342
+        if (is_array($var)) {
343 343
             $localized_vars = array();
344
-            foreach ( (array)$var as $key => $value ) {
345
-                $localized_vars[ $key ] = $this->encodeJsonVars( $value );
344
+            foreach ((array) $var as $key => $value) {
345
+                $localized_vars[$key] = $this->encodeJsonVars($value);
346 346
             }
347 347
             return $localized_vars;
348
-        } else if ( is_scalar( $var ) ) {
349
-            return html_entity_decode( (string)$var, ENT_QUOTES, 'UTF-8' );
348
+        } else if (is_scalar($var)) {
349
+            return html_entity_decode((string) $var, ENT_QUOTES, 'UTF-8');
350 350
         }
351 351
         return null;
352 352
     }
Please login to merge, or discard this patch.
form_sections/inputs/EE_Checkbox_Dropdown_Selector_Input.input.php 2 patches
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 
@@ -17,65 +17,65 @@  discard block
 block discarded – undo
17 17
 class EE_Checkbox_Dropdown_Selector_Input extends EE_Form_Input_With_Options_Base
18 18
 {
19 19
 
20
-    /**
21
-     * @var string text to display on the select button itself
22
-     */
23
-    protected $_select_button_text;
20
+	/**
21
+	 * @var string text to display on the select button itself
22
+	 */
23
+	protected $_select_button_text;
24 24
 
25
-    /**
26
-     * @param array $answer_options
27
-     * @param array $input_settings
28
-     */
29
-    public function __construct($answer_options, $input_settings = array())
30
-    {
31
-        $this->_select_button_text = EEH_Array::is_set( $input_settings, 'select_button_text',
32
-            esc_html__('Select', 'event_espresso'));
33
-        $display_strategy = new EE_Checkbox_Dropdown_Selector_Display_Strategy();
34
-        $this->_set_display_strategy($display_strategy);
35
-        $this->load_iframe_assets($display_strategy);
36
-        $this->_add_validation_strategy(
37
-            new EE_Many_Valued_Validation_Strategy(
38
-                array(
39
-                    new EE_Enum_Validation_Strategy(
40
-                        isset($input_settings['validation_error_message'])
41
-                            ? $input_settings['validation_error_message']
42
-                            : null
43
-                    ),
44
-                )
45
-            )
46
-        );
47
-        $this->_multiple_selections = true;
48
-        parent::__construct($answer_options, $input_settings);
49
-    }
25
+	/**
26
+	 * @param array $answer_options
27
+	 * @param array $input_settings
28
+	 */
29
+	public function __construct($answer_options, $input_settings = array())
30
+	{
31
+		$this->_select_button_text = EEH_Array::is_set( $input_settings, 'select_button_text',
32
+			esc_html__('Select', 'event_espresso'));
33
+		$display_strategy = new EE_Checkbox_Dropdown_Selector_Display_Strategy();
34
+		$this->_set_display_strategy($display_strategy);
35
+		$this->load_iframe_assets($display_strategy);
36
+		$this->_add_validation_strategy(
37
+			new EE_Many_Valued_Validation_Strategy(
38
+				array(
39
+					new EE_Enum_Validation_Strategy(
40
+						isset($input_settings['validation_error_message'])
41
+							? $input_settings['validation_error_message']
42
+							: null
43
+					),
44
+				)
45
+			)
46
+		);
47
+		$this->_multiple_selections = true;
48
+		parent::__construct($answer_options, $input_settings);
49
+	}
50 50
 
51
-    /*
51
+	/*
52 52
      * Returns the text to display in the select button
53 53
      */
54
-    public function select_button_text(){
55
-        return $this->_select_button_text;
56
-    }
54
+	public function select_button_text(){
55
+		return $this->_select_button_text;
56
+	}
57 57
 
58
-    /*
58
+	/*
59 59
      * add css and js for iframes
60 60
      */
61
-    protected function load_iframe_assets(EE_Checkbox_Dropdown_Selector_Display_Strategy $display_strategy){
62
-        add_filter(
63
-            'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
64
-            array($display_strategy, 'iframe_css')
65
-        );
66
-        add_filter(
67
-            'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
68
-            array($display_strategy, 'iframe_js')
69
-        );
70
-        add_filter(
71
-            'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css',
72
-            array($display_strategy, 'iframe_css')
73
-        );
74
-        add_filter(
75
-            'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js',
76
-            array($display_strategy, 'iframe_js')
77
-        );
78
-    }
61
+	protected function load_iframe_assets(EE_Checkbox_Dropdown_Selector_Display_Strategy $display_strategy){
62
+		add_filter(
63
+			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
64
+			array($display_strategy, 'iframe_css')
65
+		);
66
+		add_filter(
67
+			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
68
+			array($display_strategy, 'iframe_js')
69
+		);
70
+		add_filter(
71
+			'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css',
72
+			array($display_strategy, 'iframe_css')
73
+		);
74
+		add_filter(
75
+			'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js',
76
+			array($display_strategy, 'iframe_js')
77
+		);
78
+	}
79 79
 
80 80
 
81 81
 }
82 82
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function __construct($answer_options, $input_settings = array())
30 30
     {
31
-        $this->_select_button_text = EEH_Array::is_set( $input_settings, 'select_button_text',
31
+        $this->_select_button_text = EEH_Array::is_set($input_settings, 'select_button_text',
32 32
             esc_html__('Select', 'event_espresso'));
33 33
         $display_strategy = new EE_Checkbox_Dropdown_Selector_Display_Strategy();
34 34
         $this->_set_display_strategy($display_strategy);
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
     /*
52 52
      * Returns the text to display in the select button
53 53
      */
54
-    public function select_button_text(){
54
+    public function select_button_text() {
55 55
         return $this->_select_button_text;
56 56
     }
57 57
 
58 58
     /*
59 59
      * add css and js for iframes
60 60
      */
61
-    protected function load_iframe_assets(EE_Checkbox_Dropdown_Selector_Display_Strategy $display_strategy){
61
+    protected function load_iframe_assets(EE_Checkbox_Dropdown_Selector_Display_Strategy $display_strategy) {
62 62
         add_filter(
63 63
             'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
64 64
             array($display_strategy, 'iframe_css')
Please login to merge, or discard this patch.