@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 3 | - exit( 'No direct script access allowed' ); |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 3 | + exit('No direct script access allowed'); |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | * @param mixed $info |
| 40 | 40 | * @return bool |
| 41 | 41 | */ |
| 42 | - public function add( $object, $info = null ) { |
|
| 43 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
| 44 | - return parent::add( $object, $info ); |
|
| 42 | + public function add($object, $info = null) { |
|
| 43 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
| 44 | + return parent::add($object, $info); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | * @param mixed $info |
| 58 | 58 | * @return bool |
| 59 | 59 | */ |
| 60 | - public function set_info( $object, $info = null ) { |
|
| 61 | - $info = empty( $info ) && $object instanceof $this->interface ? $object->name : $info; |
|
| 62 | - return parent::set_info( $object, $info ); |
|
| 60 | + public function set_info($object, $info = null) { |
|
| 61 | + $info = empty($info) && $object instanceof $this->interface ? $object->name : $info; |
|
| 62 | + return parent::set_info($object, $info); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | * @param mixed |
| 75 | 75 | * @return null | object |
| 76 | 76 | */ |
| 77 | - public function get_by_info( $info ) { |
|
| 78 | - return parent::get_by_info( str_replace( ' ', '_', strtolower( $info ) ) ); |
|
| 77 | + public function get_by_info($info) { |
|
| 78 | + return parent::get_by_info(str_replace(' ', '_', strtolower($info))); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | * @param object $object |
| 90 | 90 | * @return bool |
| 91 | 91 | */ |
| 92 | - public function has( $object ) { |
|
| 93 | - return parent::has( $object ); |
|
| 92 | + public function has($object) { |
|
| 93 | + return parent::has($object); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | * @param string $messenger_name |
| 105 | 105 | * @return bool |
| 106 | 106 | */ |
| 107 | - public function has_by_name( $messenger_name ) { |
|
| 108 | - return $this->get_by_info( $messenger_name ) instanceof $this->interface ? true : false; |
|
| 107 | + public function has_by_name($messenger_name) { |
|
| 108 | + return $this->get_by_info($messenger_name) instanceof $this->interface ? true : false; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | * @param $object |
| 120 | 120 | * @return bool |
| 121 | 121 | */ |
| 122 | - public function remove( $object ) { |
|
| 123 | - return parent::remove( $object ); |
|
| 122 | + public function remove($object) { |
|
| 123 | + return parent::remove($object); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | * @param $object |
| 149 | 149 | * @return void |
| 150 | 150 | */ |
| 151 | - public function set_current( $object ) { |
|
| 152 | - parent::set_current( $object ); |
|
| 151 | + public function set_current($object) { |
|
| 152 | + parent::set_current($object); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | * @param $info |
| 164 | 164 | * @return void |
| 165 | 165 | */ |
| 166 | - public function set_current_by_info( $info ) { |
|
| 167 | - parent::set_current_by_info( $info ); |
|
| 166 | + public function set_current_by_info($info) { |
|
| 167 | + parent::set_current_by_info($info); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | * @return void |
| 179 | 179 | */ |
| 180 | 180 | public function show_collection_classes() { |
| 181 | - if ( WP_DEBUG ) { |
|
| 181 | + if (WP_DEBUG) { |
|
| 182 | 182 | $this->rewind(); |
| 183 | - while ( $this->valid() ) { |
|
| 184 | - echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : . <span style="color:#E76700">' . $this->getInfo() . '</span></h5>'; |
|
| 183 | + while ($this->valid()) { |
|
| 184 | + echo '<h5 style="color:#2EA2CC;">'.__CLASS__.' class : . <span style="color:#E76700">'.$this->getInfo().'</span></h5>'; |
|
| 185 | 185 | $this->next(); |
| 186 | 186 | } |
| 187 | 187 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | * @param mixed $data incoming data object|array. Suggested that child classes use type hinting for expected |
| 267 | 267 | * data object. But here parent will be generic because we don't know what's coming in. |
| 268 | 268 | */ |
| 269 | - public function __construct( $data ) { |
|
| 269 | + public function __construct($data) { |
|
| 270 | 270 | $this->_data = $data; |
| 271 | 271 | $this->_setup_data(); |
| 272 | 272 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * |
| 289 | 289 | * @return mixed The prepped data for db |
| 290 | 290 | */ |
| 291 | - static public function convert_data_for_persistent_storage( $data ) { |
|
| 291 | + static public function convert_data_for_persistent_storage($data) { |
|
| 292 | 292 | return $data; |
| 293 | 293 | } |
| 294 | 294 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | * |
| 305 | 305 | * @return mixed |
| 306 | 306 | */ |
| 307 | - static public function convert_data_from_persistent_storage( $data ) { |
|
| 307 | + static public function convert_data_from_persistent_storage($data) { |
|
| 308 | 308 | return $data; |
| 309 | 309 | } |
| 310 | 310 | |
@@ -331,8 +331,8 @@ discard block |
||
| 331 | 331 | protected function _assemble_data() { |
| 332 | 332 | //verify that reg_objs is set |
| 333 | 333 | if ( |
| 334 | - ! is_array( $this->reg_objs ) |
|
| 335 | - && ! reset( $this->reg_objs ) instanceof EE_Registration |
|
| 334 | + ! is_array($this->reg_objs) |
|
| 335 | + && ! reset($this->reg_objs) instanceof EE_Registration |
|
| 336 | 336 | ) { |
| 337 | 337 | throw new EE_Error( |
| 338 | 338 | __( |
@@ -347,82 +347,82 @@ discard block |
||
| 347 | 347 | $answers = $questions = $attendees = $line_items = $registrations = array(); |
| 348 | 348 | $total_ticket_count = 0; |
| 349 | 349 | |
| 350 | - if ( ! empty( $this->reg_objs ) ) { |
|
| 350 | + if ( ! empty($this->reg_objs)) { |
|
| 351 | 351 | $event_attendee_count = array(); |
| 352 | - foreach ( $this->reg_objs as $reg ) { |
|
| 352 | + foreach ($this->reg_objs as $reg) { |
|
| 353 | 353 | //account for filtered registrations by status. |
| 354 | - if ( ! empty( $this->filtered_reg_status ) && $this->filtered_reg_status !== $reg->status_ID() ) { |
|
| 354 | + if ( ! empty($this->filtered_reg_status) && $this->filtered_reg_status !== $reg->status_ID()) { |
|
| 355 | 355 | continue; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | $evt_id = $reg->event_ID(); |
| 359 | 359 | /** @type EE_Ticket $ticket */ |
| 360 | - $ticket = $reg->get_first_related( 'Ticket' ); |
|
| 360 | + $ticket = $reg->get_first_related('Ticket'); |
|
| 361 | 361 | $relateddatetime = $ticket->datetimes(); |
| 362 | 362 | $total_ticket_count++; |
| 363 | - $tickets[ $ticket->ID() ]['ticket'] = $ticket; |
|
| 364 | - $tickets[ $ticket->ID() ]['count'] = is_array( $tickets[ $ticket->ID() ] ) |
|
| 365 | - && isset( $tickets[ $ticket->ID() ]['count'] ) |
|
| 366 | - ? $tickets[ $ticket->ID() ]['count'] + 1 |
|
| 363 | + $tickets[$ticket->ID()]['ticket'] = $ticket; |
|
| 364 | + $tickets[$ticket->ID()]['count'] = is_array($tickets[$ticket->ID()]) |
|
| 365 | + && isset($tickets[$ticket->ID()]['count']) |
|
| 366 | + ? $tickets[$ticket->ID()]['count'] + 1 |
|
| 367 | 367 | : 1; |
| 368 | - $tickets[ $ticket->ID() ]['att_objs'][ $reg->attendee_ID() ] = $reg->attendee(); |
|
| 369 | - $tickets[ $ticket->ID() ]['dtt_objs'] = $relateddatetime; |
|
| 370 | - $tickets[ $ticket->ID() ]['reg_objs'][ $reg->ID() ] = $reg; |
|
| 368 | + $tickets[$ticket->ID()]['att_objs'][$reg->attendee_ID()] = $reg->attendee(); |
|
| 369 | + $tickets[$ticket->ID()]['dtt_objs'] = $relateddatetime; |
|
| 370 | + $tickets[$ticket->ID()]['reg_objs'][$reg->ID()] = $reg; |
|
| 371 | 371 | $event = $reg->event(); |
| 372 | - $tickets[ $ticket->ID() ]['EE_Event'] = $event; |
|
| 373 | - $evtcache[ $evt_id ] = $event; |
|
| 374 | - $eventsetup[ $evt_id ]['reg_objs'][ $reg->ID() ] = $reg; |
|
| 375 | - $eventsetup[ $evt_id ]['tkt_objs'][ $ticket->ID() ] = $ticket; |
|
| 376 | - $eventsetup[ $evt_id ]['att_objs'][ $reg->attendee_ID() ] = $reg->attendee(); |
|
| 377 | - $event_attendee_count[ $evt_id ] = isset( $event_attendee_count[ $evt_id ] ) |
|
| 378 | - ? $event_attendee_count[ $evt_id ] + 1 |
|
| 372 | + $tickets[$ticket->ID()]['EE_Event'] = $event; |
|
| 373 | + $evtcache[$evt_id] = $event; |
|
| 374 | + $eventsetup[$evt_id]['reg_objs'][$reg->ID()] = $reg; |
|
| 375 | + $eventsetup[$evt_id]['tkt_objs'][$ticket->ID()] = $ticket; |
|
| 376 | + $eventsetup[$evt_id]['att_objs'][$reg->attendee_ID()] = $reg->attendee(); |
|
| 377 | + $event_attendee_count[$evt_id] = isset($event_attendee_count[$evt_id]) |
|
| 378 | + ? $event_attendee_count[$evt_id] + 1 |
|
| 379 | 379 | : 0; |
| 380 | - $attendees[ $reg->attendee_ID() ]['line_ref'][] = $evt_id; |
|
| 381 | - $attendees[ $reg->attendee_ID() ]['att_obj'] = $reg->attendee(); |
|
| 382 | - $attendees[ $reg->attendee_ID() ]['reg_objs'][ $reg->ID() ] = $reg; |
|
| 380 | + $attendees[$reg->attendee_ID()]['line_ref'][] = $evt_id; |
|
| 381 | + $attendees[$reg->attendee_ID()]['att_obj'] = $reg->attendee(); |
|
| 382 | + $attendees[$reg->attendee_ID()]['reg_objs'][$reg->ID()] = $reg; |
|
| 383 | 383 | //$attendees[ $reg->attendee_ID() ]['registration_id'] = $reg->ID(); |
| 384 | - $attendees[ $reg->attendee_ID() ]['attendee_email'] = $reg->attendee() instanceof EE_Attendee |
|
| 384 | + $attendees[$reg->attendee_ID()]['attendee_email'] = $reg->attendee() instanceof EE_Attendee |
|
| 385 | 385 | ? $reg->attendee()->email() |
| 386 | 386 | : ''; |
| 387 | - $attendees[ $reg->attendee_ID() ]['tkt_objs'][ $ticket->ID() ] = $ticket; |
|
| 388 | - $attendees[ $reg->attendee_ID() ]['evt_objs'][ $evt_id ] = $event; |
|
| 387 | + $attendees[$reg->attendee_ID()]['tkt_objs'][$ticket->ID()] = $ticket; |
|
| 388 | + $attendees[$reg->attendee_ID()]['evt_objs'][$evt_id] = $event; |
|
| 389 | 389 | |
| 390 | 390 | //registrations |
| 391 | - $registrations[ $reg->ID() ]['tkt_obj'] = $ticket; |
|
| 392 | - $registrations[ $reg->ID() ]['evt_obj'] = $event; |
|
| 393 | - $registrations[ $reg->ID() ]['reg_obj'] = $reg; |
|
| 394 | - $registrations[ $reg->ID() ]['att_obj'] = $reg->attendee(); |
|
| 391 | + $registrations[$reg->ID()]['tkt_obj'] = $ticket; |
|
| 392 | + $registrations[$reg->ID()]['evt_obj'] = $event; |
|
| 393 | + $registrations[$reg->ID()]['reg_obj'] = $reg; |
|
| 394 | + $registrations[$reg->ID()]['att_obj'] = $reg->attendee(); |
|
| 395 | 395 | |
| 396 | 396 | //set up answer objects |
| 397 | - $rel_ans = $reg->get_many_related( 'Answer' ); |
|
| 398 | - foreach ( $rel_ans as $ansid => $answer ) { |
|
| 399 | - if ( ! isset( $questions[ $ansid ] ) ) { |
|
| 400 | - $questions[ $ansid ] = $answer->get_first_related( 'Question' ); |
|
| 397 | + $rel_ans = $reg->get_many_related('Answer'); |
|
| 398 | + foreach ($rel_ans as $ansid => $answer) { |
|
| 399 | + if ( ! isset($questions[$ansid])) { |
|
| 400 | + $questions[$ansid] = $answer->get_first_related('Question'); |
|
| 401 | 401 | } |
| 402 | - $answers[ $ansid ] = $answer; |
|
| 403 | - $registrations[ $reg->ID() ]['ans_objs'][ $ansid ] = $answer; |
|
| 402 | + $answers[$ansid] = $answer; |
|
| 403 | + $registrations[$reg->ID()]['ans_objs'][$ansid] = $answer; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - foreach ( $relateddatetime as $dtt_id => $datetime ) { |
|
| 407 | - $eventsetup[ $evt_id ]['dtt_objs'][ $dtt_id ] = $datetime; |
|
| 408 | - $registrations[ $reg->ID() ]['dtt_objs'][ $dtt_id ] = $datetime; |
|
| 406 | + foreach ($relateddatetime as $dtt_id => $datetime) { |
|
| 407 | + $eventsetup[$evt_id]['dtt_objs'][$dtt_id] = $datetime; |
|
| 408 | + $registrations[$reg->ID()]['dtt_objs'][$dtt_id] = $datetime; |
|
| 409 | 409 | |
| 410 | - if ( isset( $datetimes[ $dtt_id ] ) ) { |
|
| 410 | + if (isset($datetimes[$dtt_id])) { |
|
| 411 | 411 | continue; //already have this info in the datetimes array. |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - $datetimes[ $dtt_id ]['tkt_objs'][] = $ticket; |
|
| 415 | - $datetimes[ $dtt_id ]['datetime'] = $datetime; |
|
| 416 | - $datetimes[ $dtt_id ]['evt_objs'][ $evt_id ] = $event; |
|
| 417 | - $datetimes[ $dtt_id ]['reg_objs'][ $reg->ID() ] = $reg; |
|
| 414 | + $datetimes[$dtt_id]['tkt_objs'][] = $ticket; |
|
| 415 | + $datetimes[$dtt_id]['datetime'] = $datetime; |
|
| 416 | + $datetimes[$dtt_id]['evt_objs'][$evt_id] = $event; |
|
| 417 | + $datetimes[$dtt_id]['reg_objs'][$reg->ID()] = $reg; |
|
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | //let's loop through the unique event=>reg items and setup data on them |
| 422 | 422 | |
| 423 | - if ( ! empty( $eventsetup ) ) { |
|
| 424 | - foreach ( $eventsetup as $evt_id => $items ) { |
|
| 425 | - if ( $this->txn instanceof EE_Transaction ) { |
|
| 423 | + if ( ! empty($eventsetup)) { |
|
| 424 | + foreach ($eventsetup as $evt_id => $items) { |
|
| 425 | + if ($this->txn instanceof EE_Transaction) { |
|
| 426 | 426 | $ticket_line_items_for_event = EEM_Line_Item::instance()->get_all( |
| 427 | 427 | array( |
| 428 | 428 | array( |
@@ -435,25 +435,25 @@ discard block |
||
| 435 | 435 | } else { |
| 436 | 436 | $ticket_line_items_for_event = array(); |
| 437 | 437 | } |
| 438 | - $events[ $evt_id ] = array( |
|
| 438 | + $events[$evt_id] = array( |
|
| 439 | 439 | 'ID' => $evt_id, |
| 440 | - 'event' => $evtcache[ $evt_id ], |
|
| 441 | - 'name' => $evtcache[ $evt_id ] instanceof EE_Event ? $evtcache[ $evt_id ]->name() : '', |
|
| 442 | - 'total_attendees' => $event_attendee_count[ $evt_id ], |
|
| 440 | + 'event' => $evtcache[$evt_id], |
|
| 441 | + 'name' => $evtcache[$evt_id] instanceof EE_Event ? $evtcache[$evt_id]->name() : '', |
|
| 442 | + 'total_attendees' => $event_attendee_count[$evt_id], |
|
| 443 | 443 | 'reg_objs' => $items['reg_objs'], |
| 444 | 444 | 'tkt_objs' => $items['tkt_objs'], |
| 445 | 445 | 'att_objs' => $items['att_objs'], |
| 446 | - 'dtt_objs' => isset( $items['dtt_objs'] ) ? $items['dtt_objs'] : array(), |
|
| 446 | + 'dtt_objs' => isset($items['dtt_objs']) ? $items['dtt_objs'] : array(), |
|
| 447 | 447 | 'line_items' => $ticket_line_items_for_event, |
| 448 | 448 | ); |
| 449 | 449 | |
| 450 | 450 | //make sure the tickets have the line items setup for them. |
| 451 | - foreach ( $ticket_line_items_for_event as $line_id => $line_item ) { |
|
| 452 | - if ( $line_item instanceof EE_Line_Item ) { |
|
| 453 | - $tickets[ $line_item->ticket()->ID() ]['line_item'] = $line_item; |
|
| 454 | - $tickets[ $line_item->ticket()->ID() ]['sub_line_items'] = $line_item->children(); |
|
| 455 | - $line_items[ $line_item->ID() ]['children'] = $line_item->children(); |
|
| 456 | - $line_items[ $line_item->ID() ]['EE_Ticket'] = $line_item->ticket(); |
|
| 451 | + foreach ($ticket_line_items_for_event as $line_id => $line_item) { |
|
| 452 | + if ($line_item instanceof EE_Line_Item) { |
|
| 453 | + $tickets[$line_item->ticket()->ID()]['line_item'] = $line_item; |
|
| 454 | + $tickets[$line_item->ticket()->ID()]['sub_line_items'] = $line_item->children(); |
|
| 455 | + $line_items[$line_item->ID()]['children'] = $line_item->children(); |
|
| 456 | + $line_items[$line_item->ID()]['EE_Ticket'] = $line_item->ticket(); |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | } |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $this->total_ticket_count = $total_ticket_count; |
| 476 | 476 | $this->registrations = $registrations; |
| 477 | 477 | |
| 478 | - if ( $this->txn instanceof EE_Transaction ) { |
|
| 478 | + if ($this->txn instanceof EE_Transaction) { |
|
| 479 | 479 | $this->tax_line_items = $this->txn->tax_items(); |
| 480 | 480 | $this->additional_line_items = $this->txn->non_ticket_line_items(); |
| 481 | 481 | $this->payments = $this->txn->payments(); |
@@ -485,10 +485,10 @@ discard block |
||
| 485 | 485 | //let's get just the primary_attendee_data! First we get the primary registration object. |
| 486 | 486 | $primary_reg = $this->txn->primary_registration(); |
| 487 | 487 | // verify |
| 488 | - if ( $primary_reg instanceof EE_Registration ) { |
|
| 488 | + if ($primary_reg instanceof EE_Registration) { |
|
| 489 | 489 | |
| 490 | 490 | // get attendee object |
| 491 | - if ( $primary_reg->attendee() instanceof EE_Attendee ) { |
|
| 491 | + if ($primary_reg->attendee() instanceof EE_Attendee) { |
|
| 492 | 492 | |
| 493 | 493 | //now we can setup the primary_attendee_data array |
| 494 | 494 | $this->primary_attendee_data = array( |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 3 | - exit( 'No direct script access allowed' ); |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 3 | + exit('No direct script access allowed'); |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | * @param \EE_Request $request |
| 71 | 71 | * @param \EE_Response $response |
| 72 | 72 | */ |
| 73 | - protected function __construct( EE_Request $request, EE_Response $response ) { |
|
| 73 | + protected function __construct(EE_Request $request, EE_Response $response) { |
|
| 74 | 74 | $this->_request = $request; |
| 75 | 75 | $this->_response = $response; |
| 76 | - add_action( 'EE_Load_Espresso_Core__handle_request__initialize_core_loading', array( $this, 'initialize' ) ); |
|
| 77 | - do_action( 'EE_Dependency_Map____construct' ); |
|
| 76 | + add_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading', array($this, 'initialize')); |
|
| 77 | + do_action('EE_Dependency_Map____construct'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | * @param \EE_Response $response |
| 96 | 96 | * @return \EE_Dependency_Map instance |
| 97 | 97 | */ |
| 98 | - public static function instance( EE_Request $request = null, EE_Response $response = null ) { |
|
| 98 | + public static function instance(EE_Request $request = null, EE_Response $response = null) { |
|
| 99 | 99 | // check if class object is instantiated, and instantiated properly |
| 100 | - if ( ! self::$_instance instanceof EE_Dependency_Map ) { |
|
| 101 | - self::$_instance = new EE_Dependency_Map( $request, $response ); |
|
| 100 | + if ( ! self::$_instance instanceof EE_Dependency_Map) { |
|
| 101 | + self::$_instance = new EE_Dependency_Map($request, $response); |
|
| 102 | 102 | } |
| 103 | 103 | return self::$_instance; |
| 104 | 104 | } |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | * @param array $dependencies |
| 111 | 111 | * @return boolean |
| 112 | 112 | */ |
| 113 | - public static function register_dependencies( $class, $dependencies ) { |
|
| 114 | - if ( ! isset( self::$_instance->_dependency_map[ $class ] ) ) { |
|
| 115 | - self::$_instance->_dependency_map[ $class ] = (array)$dependencies; |
|
| 113 | + public static function register_dependencies($class, $dependencies) { |
|
| 114 | + if ( ! isset(self::$_instance->_dependency_map[$class])) { |
|
| 115 | + self::$_instance->_dependency_map[$class] = (array) $dependencies; |
|
| 116 | 116 | return true; |
| 117 | 117 | } |
| 118 | 118 | return false; |
@@ -126,18 +126,18 @@ discard block |
||
| 126 | 126 | * @return bool |
| 127 | 127 | * @throws \EE_Error |
| 128 | 128 | */ |
| 129 | - public static function register_class_loader( $class_name, $loader = 'load_core' ) { |
|
| 129 | + public static function register_class_loader($class_name, $loader = 'load_core') { |
|
| 130 | 130 | // check that loader method starts with "load_" and exists in EE_Registry |
| 131 | - if ( strpos( $loader, 'load_' ) !== 0 || ! method_exists( 'EE_Registry', $loader ) ) { |
|
| 131 | + if (strpos($loader, 'load_') !== 0 || ! method_exists('EE_Registry', $loader)) { |
|
| 132 | 132 | throw new EE_Error( |
| 133 | 133 | sprintf( |
| 134 | - __( '"%1$s" is not a valid loader method on EE_Registry.', 'event_espresso' ), |
|
| 134 | + __('"%1$s" is not a valid loader method on EE_Registry.', 'event_espresso'), |
|
| 135 | 135 | $loader |
| 136 | 136 | ) |
| 137 | 137 | ); |
| 138 | 138 | } |
| 139 | - if ( ! isset( self::$_instance->_class_loaders[ $class_name ] ) ) { |
|
| 140 | - self::$_instance->_class_loaders[ $class_name ] = $loader; |
|
| 139 | + if ( ! isset(self::$_instance->_class_loaders[$class_name])) { |
|
| 140 | + self::$_instance->_class_loaders[$class_name] = $loader; |
|
| 141 | 141 | return true; |
| 142 | 142 | } |
| 143 | 143 | return false; |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | * @param string $class_name |
| 161 | 161 | * @return boolean |
| 162 | 162 | */ |
| 163 | - public function has( $class_name = '' ) { |
|
| 164 | - return isset( $this->_dependency_map[ $class_name ] ) ? true : false; |
|
| 163 | + public function has($class_name = '') { |
|
| 164 | + return isset($this->_dependency_map[$class_name]) ? true : false; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | * @param string $dependency |
| 174 | 174 | * @return bool |
| 175 | 175 | */ |
| 176 | - public function has_dependency_for_class( $class_name = '', $dependency = '' ) { |
|
| 177 | - return isset( $this->_dependency_map[ $class_name ], $this->_dependency_map[ $class_name ][ $dependency ] ) |
|
| 176 | + public function has_dependency_for_class($class_name = '', $dependency = '') { |
|
| 177 | + return isset($this->_dependency_map[$class_name], $this->_dependency_map[$class_name][$dependency]) |
|
| 178 | 178 | ? true |
| 179 | 179 | : false; |
| 180 | 180 | } |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | * @param string $dependency |
| 189 | 189 | * @return int |
| 190 | 190 | */ |
| 191 | - public function loading_strategy_for_class_dependency( $class_name = '', $dependency = '' ) { |
|
| 192 | - return $this->has_dependency_for_class( $class_name, $dependency ) |
|
| 193 | - ? $this->_dependency_map[ $class_name ][ $dependency ] |
|
| 191 | + public function loading_strategy_for_class_dependency($class_name = '', $dependency = '') { |
|
| 192 | + return $this->has_dependency_for_class($class_name, $dependency) |
|
| 193 | + ? $this->_dependency_map[$class_name][$dependency] |
|
| 194 | 194 | : EE_Dependency_Map::not_registered; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | * @param string $class_name |
| 201 | 201 | * @return string | Closure |
| 202 | 202 | */ |
| 203 | - public function class_loader( $class_name ) { |
|
| 204 | - return isset( $this->_class_loaders[ $class_name ] ) ? $this->_class_loaders[ $class_name ] : ''; |
|
| 203 | + public function class_loader($class_name) { |
|
| 204 | + return isset($this->_class_loaders[$class_name]) ? $this->_class_loaders[$class_name] : ''; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
@@ -339,17 +339,17 @@ discard block |
||
| 339 | 339 | 'EE_Messages_Data_Handler_Collection' => 'load_lib', |
| 340 | 340 | 'EE_Message_Template_Group_Collection' => 'load_lib', |
| 341 | 341 | 'EE_Messages_Generator' => function() { |
| 342 | - return EE_Registry::instance()->load_lib( 'Messages_Generator', array(), false, false ); |
|
| 342 | + return EE_Registry::instance()->load_lib('Messages_Generator', array(), false, false); |
|
| 343 | 343 | }, |
| 344 | - 'EE_Messages_Template_Defaults' => function( $arguments = array() ) { |
|
| 345 | - return EE_Registry::instance()->load_lib( 'Messages_Template_Defaults', $arguments, false, false ); |
|
| 344 | + 'EE_Messages_Template_Defaults' => function($arguments = array()) { |
|
| 345 | + return EE_Registry::instance()->load_lib('Messages_Template_Defaults', $arguments, false, false); |
|
| 346 | 346 | }, |
| 347 | 347 | //load_model |
| 348 | 348 | 'EEM_Message_Template_Group' => 'load_model', |
| 349 | 349 | 'EEM_Message_Template' => 'load_model', |
| 350 | 350 | //load_helper |
| 351 | 351 | 'EEH_Parse_Shortcodes' => function() { |
| 352 | - if ( EE_Registry::instance()->load_helper( 'Parse_Shortcodes' ) ) { |
|
| 352 | + if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) { |
|
| 353 | 353 | return new EEH_Parse_Shortcodes(); |
| 354 | 354 | } |
| 355 | 355 | return null; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('No direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -24,18 +24,18 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * ------------------------------------------------------------------------ |
| 26 | 26 | */ |
| 27 | -class EE_Year_Input extends EE_Select_Input{ |
|
| 27 | +class EE_Year_Input extends EE_Select_Input { |
|
| 28 | 28 | |
| 29 | - function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0 ){ |
|
| 30 | - if($four_digit_year){ |
|
| 29 | + function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0) { |
|
| 30 | + if ($four_digit_year) { |
|
| 31 | 31 | $current_year_int = intval(date('Y')); |
| 32 | - }else{ |
|
| 32 | + } else { |
|
| 33 | 33 | $current_year_int = intval(date('y')); |
| 34 | 34 | } |
| 35 | 35 | $answer_options = array(); |
| 36 | - for( $start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++){ |
|
| 36 | + for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
|
| 37 | 37 | $answer_options[$start] = $start; |
| 38 | 38 | } |
| 39 | - parent::__construct( $answer_options, $input_settings ); |
|
| 39 | + parent::__construct($answer_options, $input_settings); |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -10,21 +10,21 @@ discard block |
||
| 10 | 10 | * @since 4.6 |
| 11 | 11 | * |
| 12 | 12 | */ |
| 13 | -class EE_Full_HTML_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
| 13 | +class EE_Full_HTML_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * @param null $validation_error_message |
| 17 | 17 | */ |
| 18 | - public function __construct( $validation_error_message = NULL ) { |
|
| 19 | - if ( ! $validation_error_message ) { |
|
| 18 | + public function __construct($validation_error_message = NULL) { |
|
| 19 | + if ( ! $validation_error_message) { |
|
| 20 | 20 | global $allowedposttags; |
| 21 | 21 | $validation_error_message = sprintf( |
| 22 | - __( 'Only the following HTML tags are allowed:%1$s%2$s', "event_espresso" ), |
|
| 22 | + __('Only the following HTML tags are allowed:%1$s%2$s', "event_espresso"), |
|
| 23 | 23 | '<br />', |
| 24 | - implode( ",", array_keys( $allowedposttags ) ) |
|
| 24 | + implode(",", array_keys($allowedposttags)) |
|
| 25 | 25 | ); |
| 26 | 26 | } |
| 27 | - parent::__construct( $validation_error_message ); |
|
| 27 | + parent::__construct($validation_error_message); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function get_list_of_allowed_tags() { |
| 40 | 40 | global $allowedposttags; |
| 41 | - ksort( $allowedposttags ); |
|
| 42 | - return implode( ', ', array_keys( $allowedposttags ) ); |
|
| 41 | + ksort($allowedposttags); |
|
| 42 | + return implode(', ', array_keys($allowedposttags)); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function validate($normalized_value) { |
| 52 | 52 | global $allowedposttags; |
| 53 | - parent::validate( $normalized_value ); |
|
| 54 | - $normalized_value_sans_tags = wp_kses( "$normalized_value", $allowedposttags ); |
|
| 55 | - if ( strlen( $normalized_value ) > strlen( $normalized_value_sans_tags ) ) { |
|
| 56 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'complex_html_tags' ); |
|
| 53 | + parent::validate($normalized_value); |
|
| 54 | + $normalized_value_sans_tags = wp_kses("$normalized_value", $allowedposttags); |
|
| 55 | + if (strlen($normalized_value) > strlen($normalized_value_sans_tags)) { |
|
| 56 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'complex_html_tags'); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -4,9 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | - * |
|
| 8 | - * @return string of html to display the field |
|
| 9 | - */ |
|
| 7 | + * |
|
| 8 | + * @return string of html to display the field |
|
| 9 | + */ |
|
| 10 | 10 | function display(){ |
| 11 | 11 | $input = $this->_input; |
| 12 | 12 | $raw_value = maybe_serialize($input->raw_value()); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base{ |
|
| 2 | +class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base { |
|
| 3 | 3 | |
| 4 | 4 | |
| 5 | 5 | |
@@ -7,31 +7,31 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | * @return string of html to display the field |
| 9 | 9 | */ |
| 10 | - function display(){ |
|
| 10 | + function display() { |
|
| 11 | 11 | $input = $this->_input; |
| 12 | 12 | $raw_value = maybe_serialize($input->raw_value()); |
| 13 | - if( $input instanceof EE_Text_Area_Input ) { |
|
| 13 | + if ($input instanceof EE_Text_Area_Input) { |
|
| 14 | 14 | $rows = $input->get_rows(); |
| 15 | 15 | $cols = $input->get_cols(); |
| 16 | - }else{ |
|
| 16 | + } else { |
|
| 17 | 17 | $rows = 4; |
| 18 | 18 | $cols = 20; |
| 19 | 19 | } |
| 20 | 20 | $html = '<textarea'; |
| 21 | - $html .= ' id="' . $input->html_id() . '"'; |
|
| 22 | - $html .= ' name="' . $input->html_name() . '"'; |
|
| 23 | - $html .= ' class="' . $input->html_class() . '"' ; |
|
| 24 | - $html .= ' style="' . $input->html_style() . '"'; |
|
| 25 | - $html .= ' rows= "' . $rows . '" cols="' . $cols . '">'; |
|
| 21 | + $html .= ' id="'.$input->html_id().'"'; |
|
| 22 | + $html .= ' name="'.$input->html_name().'"'; |
|
| 23 | + $html .= ' class="'.$input->html_class().'"'; |
|
| 24 | + $html .= ' style="'.$input->html_style().'"'; |
|
| 25 | + $html .= ' rows= "'.$rows.'" cols="'.$cols.'">'; |
|
| 26 | 26 | $html .= $raw_value; |
| 27 | 27 | $html .= '</textarea>'; |
| 28 | - foreach ( $this->_input->get_validation_strategies() as $validation_strategy ) { |
|
| 28 | + foreach ($this->_input->get_validation_strategies() as $validation_strategy) { |
|
| 29 | 29 | if ( |
| 30 | 30 | $validation_strategy instanceof EE_Simple_HTML_Validation_Strategy |
| 31 | 31 | || $validation_strategy instanceof EE_Full_HTML_Validation_Strategy |
| 32 | 32 | ) { |
| 33 | 33 | $html .= sprintf( |
| 34 | - __( '%1$s(allowed tags: %2$s)%3$s', 'event_espresso' ), |
|
| 34 | + __('%1$s(allowed tags: %2$s)%3$s', 'event_espresso'), |
|
| 35 | 35 | '<p class="ee-question-desc">', |
| 36 | 36 | $validation_strategy->get_list_of_allowed_tags(), |
| 37 | 37 | '</p>' |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | protected function _set_tips_array() { |
| 19 | 19 | $this->_qtipsa = array( |
| 20 | 20 | 0 => array( |
| 21 | - 'content_id' => 'message_status-' . EEM_Message::status_sent, |
|
| 22 | - 'target' => '.msg-status-' . EEM_Message::status_sent, |
|
| 23 | - 'content' => $this->_message_status_legend( EEM_Message::status_sent ), |
|
| 21 | + 'content_id' => 'message_status-'.EEM_Message::status_sent, |
|
| 22 | + 'target' => '.msg-status-'.EEM_Message::status_sent, |
|
| 23 | + 'content' => $this->_message_status_legend(EEM_Message::status_sent), |
|
| 24 | 24 | 'options' => array( |
| 25 | 25 | 'position' => array( |
| 26 | 26 | 'target' => 'mouse', |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | ) |
| 29 | 29 | ), |
| 30 | 30 | 1 => array( |
| 31 | - 'content_id' => 'message_status-' . EEM_Message::status_idle, |
|
| 32 | - 'target' => '.msg-status-' . EEM_Message::status_idle, |
|
| 33 | - 'content' => $this->_message_status_legend( EEM_Message::status_idle ), |
|
| 31 | + 'content_id' => 'message_status-'.EEM_Message::status_idle, |
|
| 32 | + 'target' => '.msg-status-'.EEM_Message::status_idle, |
|
| 33 | + 'content' => $this->_message_status_legend(EEM_Message::status_idle), |
|
| 34 | 34 | 'options' => array( |
| 35 | 35 | 'position' => array( |
| 36 | 36 | 'target' => 'mouse', |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | ) |
| 39 | 39 | ), |
| 40 | 40 | 2 => array( |
| 41 | - 'content_id' => 'message_status-' . EEM_Message::status_failed, |
|
| 42 | - 'target' => '.msg-status-' . EEM_Message::status_failed, |
|
| 43 | - 'content' => $this->_message_status_legend( EEM_Message::status_failed ), |
|
| 41 | + 'content_id' => 'message_status-'.EEM_Message::status_failed, |
|
| 42 | + 'target' => '.msg-status-'.EEM_Message::status_failed, |
|
| 43 | + 'content' => $this->_message_status_legend(EEM_Message::status_failed), |
|
| 44 | 44 | 'options' => array( |
| 45 | 45 | 'position' => array( |
| 46 | 46 | 'target' => 'mouse', |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | ) |
| 49 | 49 | ), |
| 50 | 50 | 3 => array( |
| 51 | - 'content_id' => 'message_status-' . EEM_Message::status_resend, |
|
| 52 | - 'target' => '.msg-status-' . EEM_Message::status_resend, |
|
| 53 | - 'content' => $this->_message_status_legend( EEM_Message::status_resend ), |
|
| 51 | + 'content_id' => 'message_status-'.EEM_Message::status_resend, |
|
| 52 | + 'target' => '.msg-status-'.EEM_Message::status_resend, |
|
| 53 | + 'content' => $this->_message_status_legend(EEM_Message::status_resend), |
|
| 54 | 54 | 'options' => array( |
| 55 | 55 | 'position' => array( |
| 56 | 56 | 'target' => 'mouse', |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | ) |
| 59 | 59 | ), |
| 60 | 60 | 4 => array( |
| 61 | - 'content_id' => 'message_status-' . EEM_Message::status_incomplete, |
|
| 62 | - 'target' => '.msg-status-' . EEM_Message::status_incomplete, |
|
| 63 | - 'content' => $this->_message_status_legend( EEM_Message::status_incomplete ), |
|
| 61 | + 'content_id' => 'message_status-'.EEM_Message::status_incomplete, |
|
| 62 | + 'target' => '.msg-status-'.EEM_Message::status_incomplete, |
|
| 63 | + 'content' => $this->_message_status_legend(EEM_Message::status_incomplete), |
|
| 64 | 64 | 'options' => array( |
| 65 | 65 | 'position' => array( |
| 66 | 66 | 'target' => 'mouse', |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | ) |
| 69 | 69 | ), |
| 70 | 70 | 5 => array( |
| 71 | - 'content_id' => 'message_status-' . EEM_Message::status_retry, |
|
| 72 | - 'target' => '.msg-status-' . EEM_Message::status_retry, |
|
| 73 | - 'content' => $this->_message_status_legend( EEM_Message::status_retry ), |
|
| 71 | + 'content_id' => 'message_status-'.EEM_Message::status_retry, |
|
| 72 | + 'target' => '.msg-status-'.EEM_Message::status_retry, |
|
| 73 | + 'content' => $this->_message_status_legend(EEM_Message::status_retry), |
|
| 74 | 74 | 'options' => array( |
| 75 | 75 | 'position' => array( |
| 76 | 76 | 'target' => 'mouse', |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | ) |
| 79 | 79 | ), |
| 80 | 80 | 6 => array( |
| 81 | - 'content_id' => 'message_status-' . EEM_Message::status_debug_only, |
|
| 82 | - 'target' => '.msg-status-' . EEM_Message::status_debug_only, |
|
| 83 | - 'content' => $this->_message_status_legend( EEM_Message::status_debug_only ), |
|
| 81 | + 'content_id' => 'message_status-'.EEM_Message::status_debug_only, |
|
| 82 | + 'target' => '.msg-status-'.EEM_Message::status_debug_only, |
|
| 83 | + 'content' => $this->_message_status_legend(EEM_Message::status_debug_only), |
|
| 84 | 84 | 'options' => array( |
| 85 | 85 | 'position' => array( |
| 86 | 86 | 'target' => 'mouse', |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param EEM_Message constant $status What status is set (by class) |
| 100 | 100 | * @return string The status legend with the related status highlighted |
| 101 | 101 | */ |
| 102 | - private function _message_status_legend( $status ) { |
|
| 102 | + private function _message_status_legend($status) { |
|
| 103 | 103 | |
| 104 | 104 | $status_array = array( |
| 105 | 105 | 'sent_status' => EEM_Message::status_sent, |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | 'retry_status' => EEM_Message::status_retry, |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 113 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 114 | 114 | $status_array['debug_only_status'] = EEM_Message::status_debug_only; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - return EEH_Template::status_legend( $status_array, $status ); |
|
| 117 | + return EEH_Template::status_legend($status_array, $status); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | \ No newline at end of file |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | public function localized_status( $statuses, $plural = FALSE, $schema = 'upper' ) { |
| 84 | 84 | //note these are all in lower case because ucwords() on upper case will NOT convert. |
| 85 | 85 | $translation_array = array( |
| 86 | - EEM_Registration::status_id_pending_payment => array( |
|
| 86 | + EEM_Registration::status_id_pending_payment => array( |
|
| 87 | 87 | __('pending payment', 'event_espresso'), //singular |
| 88 | 88 | __('pending payments', 'event_espresso') //plural |
| 89 | 89 | ), |
@@ -217,22 +217,22 @@ discard block |
||
| 217 | 217 | __('queued for sending', 'event_espresso'), |
| 218 | 218 | __('queued for sending', 'event_espresso'), |
| 219 | 219 | ), |
| 220 | - EEM_Message::status_failed => array( |
|
| 221 | - __('failed', 'event_espresso'), |
|
| 222 | - __('failed', 'event_espresso'), |
|
| 223 | - ), |
|
| 220 | + EEM_Message::status_failed => array( |
|
| 221 | + __('failed', 'event_espresso'), |
|
| 222 | + __('failed', 'event_espresso'), |
|
| 223 | + ), |
|
| 224 | 224 | EEM_Message::status_debug_only => array( |
| 225 | 225 | __( 'debug only', 'event_espresso' ), |
| 226 | 226 | __( 'debug only', 'event_espresso' ) |
| 227 | 227 | ), |
| 228 | - EEM_Message::status_resend => array( |
|
| 229 | - __('queued for resending', 'event_espresso'), |
|
| 230 | - __('queued for resending', 'event_espresso'), |
|
| 231 | - ), |
|
| 232 | - EEM_Message::status_incomplete => array( |
|
| 233 | - __('queued for generating', 'event_espresso'), |
|
| 234 | - __('queued for generating', 'event_espresso'), |
|
| 235 | - ), |
|
| 228 | + EEM_Message::status_resend => array( |
|
| 229 | + __('queued for resending', 'event_espresso'), |
|
| 230 | + __('queued for resending', 'event_espresso'), |
|
| 231 | + ), |
|
| 232 | + EEM_Message::status_incomplete => array( |
|
| 233 | + __('queued for generating', 'event_espresso'), |
|
| 234 | + __('queued for generating', 'event_espresso'), |
|
| 235 | + ), |
|
| 236 | 236 | EEM_Message::status_retry => array( |
| 237 | 237 | __('failed sending, can be retried', 'event_espresso'), |
| 238 | 238 | __('failed sending, can be retried', 'event_espresso'), |
@@ -261,37 +261,37 @@ discard block |
||
| 261 | 261 | __('trashed', 'event_espresso'), |
| 262 | 262 | __('trashed', 'event_espresso') |
| 263 | 263 | ), |
| 264 | - ); |
|
| 264 | + ); |
|
| 265 | 265 | |
| 266 | 266 | $translation_array = apply_filters( 'FHEE__EEM_Status__localized_status__translation_array', $translation_array ); |
| 267 | 267 | |
| 268 | 268 | if ( !is_array($statuses) ) |
| 269 | 269 | throw new EE_Error( __('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso') ); |
| 270 | 270 | |
| 271 | - $translation = array(); |
|
| 271 | + $translation = array(); |
|
| 272 | 272 | |
| 273 | - foreach ( $statuses as $id => $code ) { |
|
| 274 | - if ( isset( $translation_array[$id] ) ) { |
|
| 275 | - $translation[$id] = $plural ? $translation_array[$id][1] : $translation_array[$id][0]; |
|
| 276 | - } else { |
|
| 277 | - $translation[$id] = $code; |
|
| 278 | - } |
|
| 273 | + foreach ( $statuses as $id => $code ) { |
|
| 274 | + if ( isset( $translation_array[$id] ) ) { |
|
| 275 | + $translation[$id] = $plural ? $translation_array[$id][1] : $translation_array[$id][0]; |
|
| 276 | + } else { |
|
| 277 | + $translation[$id] = $code; |
|
| 278 | + } |
|
| 279 | 279 | |
| 280 | - //schema |
|
| 281 | - switch ( $schema ) { |
|
| 282 | - case 'lower' : |
|
| 283 | - $translation[$id] = strtolower( $translation[$id] ); //even though these start in lower case, this will catch any statuses added via filter. |
|
| 284 | - break; |
|
| 285 | - case 'sentence' : |
|
| 286 | - $translation[$id] = ucwords( $translation[$id] ); |
|
| 287 | - break; |
|
| 288 | - case 'upper' : |
|
| 289 | - $translation[$id] = strtoupper( $translation[$id] ); |
|
| 290 | - break; |
|
| 291 | - } |
|
| 292 | - } |
|
| 280 | + //schema |
|
| 281 | + switch ( $schema ) { |
|
| 282 | + case 'lower' : |
|
| 283 | + $translation[$id] = strtolower( $translation[$id] ); //even though these start in lower case, this will catch any statuses added via filter. |
|
| 284 | + break; |
|
| 285 | + case 'sentence' : |
|
| 286 | + $translation[$id] = ucwords( $translation[$id] ); |
|
| 287 | + break; |
|
| 288 | + case 'upper' : |
|
| 289 | + $translation[$id] = strtoupper( $translation[$id] ); |
|
| 290 | + break; |
|
| 291 | + } |
|
| 292 | + } |
|
| 293 | 293 | |
| 294 | - return $translation; |
|
| 294 | + return $translation; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * |
| 14 | 14 | * ------------------------------------------------------------------------ |
| 15 | 15 | */ |
| 16 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
| 16 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
| 17 | 17 | /** |
| 18 | 18 | * |
| 19 | 19 | * Class EEM_Status |
@@ -32,32 +32,32 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @return EEM_Status |
| 34 | 34 | */ |
| 35 | - protected function __construct( $timezone = NULL ) { |
|
| 36 | - $this->singular_item = __('Status','event_espresso'); |
|
| 37 | - $this->plural_item = __('Stati','event_espresso'); |
|
| 35 | + protected function __construct($timezone = NULL) { |
|
| 36 | + $this->singular_item = __('Status', 'event_espresso'); |
|
| 37 | + $this->plural_item = __('Stati', 'event_espresso'); |
|
| 38 | 38 | $this->_tables = array( |
| 39 | 39 | 'Status'=> new EE_Primary_Table('esp_status', 'STS_ID') |
| 40 | 40 | ); |
| 41 | 41 | $this->_fields = array( |
| 42 | 42 | 'Status'=>array( |
| 43 | - 'STS_ID'=> new EE_Primary_Key_String_Field('STS_ID', __('Status ID','event_espresso')), |
|
| 44 | - 'STS_code'=>new EE_Plain_Text_Field('STS_code',__('Status Code','event_espresso'),false, ''), |
|
| 43 | + 'STS_ID'=> new EE_Primary_Key_String_Field('STS_ID', __('Status ID', 'event_espresso')), |
|
| 44 | + 'STS_code'=>new EE_Plain_Text_Field('STS_code', __('Status Code', 'event_espresso'), false, ''), |
|
| 45 | 45 | 'STS_type'=>new EE_Enum_Text_Field( |
| 46 | 46 | 'STS_type', |
| 47 | 47 | __("Type", "event_espresso"), |
| 48 | 48 | false, |
| 49 | 49 | 'event', |
| 50 | 50 | array( |
| 51 | - 'event'=> __("Event", "event_espresso"),//deprecated |
|
| 51 | + 'event'=> __("Event", "event_espresso"), //deprecated |
|
| 52 | 52 | 'registration'=> __("Registration", "event_espresso"), |
| 53 | 53 | 'transaction'=> __("Transaction", "event_espresso"), |
| 54 | 54 | 'payment'=> __("Payment", "event_espresso"), |
| 55 | 55 | 'email'=> __("Email", "event_espresso"), |
| 56 | 56 | 'message' => __("Message", "event_espresso") |
| 57 | 57 | )), |
| 58 | - 'STS_can_edit'=>new EE_Boolean_Field('STS_can_edit', __('Editable?','event_espresso'), false), |
|
| 58 | + 'STS_can_edit'=>new EE_Boolean_Field('STS_can_edit', __('Editable?', 'event_espresso'), false), |
|
| 59 | 59 | 'STS_desc'=>new EE_Simple_HTML_Field('STS_desc', __("Description", "event_espresso"), false, ''), |
| 60 | - 'STS_open'=>new EE_Boolean_Field('STS_open', __("Open?", "event_espresso"), false,false) |
|
| 60 | + 'STS_open'=>new EE_Boolean_Field('STS_open', __("Open?", "event_espresso"), false, false) |
|
| 61 | 61 | )); |
| 62 | 62 | $this->_model_relations = array( |
| 63 | 63 | 'Registration'=>new EE_Has_Many_Relation(), |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | 'Payment'=>new EE_Has_Many_Relation() |
| 66 | 66 | ); |
| 67 | 67 | //this model is generally available for reading |
| 68 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public(); |
|
| 68 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public(); |
|
| 69 | 69 | |
| 70 | - parent::__construct( $timezone ); |
|
| 70 | + parent::__construct($timezone); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @throws EE_Error |
| 81 | 81 | * @return array an array of translated strings for the incoming status id. |
| 82 | 82 | */ |
| 83 | - public function localized_status( $statuses, $plural = FALSE, $schema = 'upper' ) { |
|
| 83 | + public function localized_status($statuses, $plural = FALSE, $schema = 'upper') { |
|
| 84 | 84 | //note these are all in lower case because ucwords() on upper case will NOT convert. |
| 85 | 85 | $translation_array = array( |
| 86 | 86 | EEM_Registration::status_id_pending_payment => array( |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | __('failed', 'event_espresso'), |
| 223 | 223 | ), |
| 224 | 224 | EEM_Message::status_debug_only => array( |
| 225 | - __( 'debug only', 'event_espresso' ), |
|
| 226 | - __( 'debug only', 'event_espresso' ) |
|
| 225 | + __('debug only', 'event_espresso'), |
|
| 226 | + __('debug only', 'event_espresso') |
|
| 227 | 227 | ), |
| 228 | 228 | EEM_Message::status_resend => array( |
| 229 | 229 | __('queued for resending', 'event_espresso'), |
@@ -263,30 +263,30 @@ discard block |
||
| 263 | 263 | ), |
| 264 | 264 | ); |
| 265 | 265 | |
| 266 | - $translation_array = apply_filters( 'FHEE__EEM_Status__localized_status__translation_array', $translation_array ); |
|
| 266 | + $translation_array = apply_filters('FHEE__EEM_Status__localized_status__translation_array', $translation_array); |
|
| 267 | 267 | |
| 268 | - if ( !is_array($statuses) ) |
|
| 269 | - throw new EE_Error( __('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso') ); |
|
| 268 | + if ( ! is_array($statuses)) |
|
| 269 | + throw new EE_Error(__('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso')); |
|
| 270 | 270 | |
| 271 | 271 | $translation = array(); |
| 272 | 272 | |
| 273 | - foreach ( $statuses as $id => $code ) { |
|
| 274 | - if ( isset( $translation_array[$id] ) ) { |
|
| 273 | + foreach ($statuses as $id => $code) { |
|
| 274 | + if (isset($translation_array[$id])) { |
|
| 275 | 275 | $translation[$id] = $plural ? $translation_array[$id][1] : $translation_array[$id][0]; |
| 276 | 276 | } else { |
| 277 | 277 | $translation[$id] = $code; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | //schema |
| 281 | - switch ( $schema ) { |
|
| 281 | + switch ($schema) { |
|
| 282 | 282 | case 'lower' : |
| 283 | - $translation[$id] = strtolower( $translation[$id] ); //even though these start in lower case, this will catch any statuses added via filter. |
|
| 283 | + $translation[$id] = strtolower($translation[$id]); //even though these start in lower case, this will catch any statuses added via filter. |
|
| 284 | 284 | break; |
| 285 | 285 | case 'sentence' : |
| 286 | - $translation[$id] = ucwords( $translation[$id] ); |
|
| 286 | + $translation[$id] = ucwords($translation[$id]); |
|
| 287 | 287 | break; |
| 288 | 288 | case 'upper' : |
| 289 | - $translation[$id] = strtoupper( $translation[$id] ); |
|
| 289 | + $translation[$id] = strtoupper($translation[$id]); |
|
| 290 | 290 | break; |
| 291 | 291 | } |
| 292 | 292 | } |
@@ -1,25 +1,25 @@ |
||
| 1 | 1 | <div class="changelog point-releases"> |
| 2 | - <!-- <h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3> --> |
|
| 3 | - <h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3> |
|
| 2 | + <!-- <h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3> --> |
|
| 3 | + <h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3> |
|
| 4 | 4 | <?php //$type = 'minor'; ?> |
| 5 | 5 | <?php $type = 'major'; ?> |
| 6 | - <p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?> |
|
| 6 | + <p><?php printf(__('<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?> |
|
| 7 | 7 | <?php |
| 8 | - $ver = explode( '.', EVENT_ESPRESSO_VERSION ); |
|
| 9 | - array_pop( $ver ); |
|
| 10 | - $ver = implode( '.', $ver ); |
|
| 8 | + $ver = explode('.', EVENT_ESPRESSO_VERSION); |
|
| 9 | + array_pop($ver); |
|
| 10 | + $ver = implode('.', $ver); |
|
| 11 | 11 | ?> |
| 12 | - <?php printf( __( 'For more information, see <a href="%s" target="_blank">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?> |
|
| 12 | + <?php printf(__('For more information, see <a href="%s" target="_blank">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?> |
|
| 13 | 13 | </p> |
| 14 | 14 | </div> |
| 15 | 15 | |
| 16 | 16 | <div class="changelog"> |
| 17 | 17 | <?php |
| 18 | 18 | //maintenance mode on? |
| 19 | - if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
| 19 | + if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
| 20 | 20 | ?> |
| 21 | 21 | <div class="ee-attention"> |
| 22 | - <h2 class="ee-maintenance-mode-callout"><?php _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2> |
|
| 22 | + <h2 class="ee-maintenance-mode-callout"><?php _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2> |
|
| 23 | 23 | <p> |
| 24 | 24 | <?php |
| 25 | 25 | printf( |