@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | /** |
504 | 504 | * @param $message_types |
505 | 505 | * @param array $extra |
506 | - * @return mixed|string |
|
506 | + * @return string |
|
507 | 507 | */ |
508 | 508 | protected function _get_admin_content_events_edit( $message_types, $extra ) { |
509 | 509 | //defaults |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | * All this does is set the existing test settings (in the db) for the messenger |
772 | 772 | * |
773 | 773 | * @access public |
774 | - * @param $settings |
|
774 | + * @param string $settings |
|
775 | 775 | * @return bool success/fail |
776 | 776 | */ |
777 | 777 | public function set_existing_test_settings( $settings ) { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use \EventEspresso\core\exceptions\SendMessageException; |
3 | 3 | |
4 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
5 | 5 | exit('NO direct script access allowed'); |
6 | 6 | |
7 | 7 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * @return void |
280 | 280 | */ |
281 | 281 | public function enqueue_scripts_styles() { |
282 | - do_action( 'AHEE__EE_messenger__enqueue_scripts_styles'); |
|
282 | + do_action('AHEE__EE_messenger__enqueue_scripts_styles'); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | |
350 | 350 | $this->_supports_labels->template_variation_description = __('These are different styles to choose from for the selected template structure. Usually these affect things like font style, color, borders etc. In some cases the styles will also make minor layout changes.'); |
351 | 351 | |
352 | - $this->_supports_labels = apply_filters( 'FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this ); |
|
352 | + $this->_supports_labels = apply_filters('FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this); |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | * @return stdClass |
365 | 365 | */ |
366 | 366 | public function get_supports_labels() { |
367 | - if ( empty( $this->_supports_labels->template_pack ) || empty( $this->_supports_labels->template_variation) ) { |
|
367 | + if (empty($this->_supports_labels->template_pack) || empty($this->_supports_labels->template_variation)) { |
|
368 | 368 | $this->_set_supports_labels_defaults(); |
369 | 369 | } |
370 | - return apply_filters( 'FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this ); |
|
370 | + return apply_filters('FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | |
@@ -387,10 +387,10 @@ discard block |
||
387 | 387 | * |
388 | 388 | * @return string path or url for the requested variation. |
389 | 389 | */ |
390 | - public function get_variation( EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE ) { |
|
390 | + public function get_variation(EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE) { |
|
391 | 391 | $this->_tmp_pack = $pack; |
392 | - $variation_path = apply_filters( 'EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters ); |
|
393 | - $variation_path = empty( $variation_path ) ? $this->_tmp_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters ) : $variation_path; |
|
392 | + $variation_path = apply_filters('EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters); |
|
393 | + $variation_path = empty($variation_path) ? $this->_tmp_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters) : $variation_path; |
|
394 | 394 | return $variation_path; |
395 | 395 | |
396 | 396 | } |
@@ -408,13 +408,13 @@ discard block |
||
408 | 408 | * @return array |
409 | 409 | */ |
410 | 410 | public function get_default_message_types() { |
411 | - $class = get_class( $this ); |
|
411 | + $class = get_class($this); |
|
412 | 412 | |
413 | 413 | //messenger specific filter |
414 | - $default_types = apply_filters( 'FHEE__' . $class . '__get_default_message_types__default_types', $this->_default_message_types, $this ); |
|
414 | + $default_types = apply_filters('FHEE__'.$class.'__get_default_message_types__default_types', $this->_default_message_types, $this); |
|
415 | 415 | |
416 | 416 | //all messengers filter |
417 | - $default_types = apply_filters( 'FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this ); |
|
417 | + $default_types = apply_filters('FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this); |
|
418 | 418 | return $default_types; |
419 | 419 | } |
420 | 420 | |
@@ -429,14 +429,14 @@ discard block |
||
429 | 429 | * @return array |
430 | 430 | */ |
431 | 431 | public function get_valid_message_types() { |
432 | - $class = get_class( $this ); |
|
432 | + $class = get_class($this); |
|
433 | 433 | |
434 | 434 | //messenger specific filter |
435 | 435 | //messenger specific filter |
436 | - $valid_types = apply_filters( 'FHEE__' . $class . '__get_valid_message_types__valid_types', $this->_valid_message_types, $this ); |
|
436 | + $valid_types = apply_filters('FHEE__'.$class.'__get_valid_message_types__valid_types', $this->_valid_message_types, $this); |
|
437 | 437 | |
438 | 438 | //all messengers filter |
439 | - $valid_types = apply_filters( 'FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this ); |
|
439 | + $valid_types = apply_filters('FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this); |
|
440 | 440 | return $valid_types; |
441 | 441 | } |
442 | 442 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | * @access public |
451 | 451 | * @param array $new_config Whatever is put in here will reset the _validator_config property |
452 | 452 | */ |
453 | - public function set_validator_config( $new_config ) { |
|
453 | + public function set_validator_config($new_config) { |
|
454 | 454 | $this->_validator_config = $new_config; |
455 | 455 | } |
456 | 456 | |
@@ -466,8 +466,8 @@ discard block |
||
466 | 466 | public function get_validator_config() { |
467 | 467 | $class = get_class($this); |
468 | 468 | |
469 | - $config = apply_filters( 'FHEE__' . $class . '__get_validator_config', $this->_validator_config, $this ); |
|
470 | - $config = apply_filters( 'FHEE__EE_messenger__get_validator_config', $config, $this ); |
|
469 | + $config = apply_filters('FHEE__'.$class.'__get_validator_config', $this->_validator_config, $this); |
|
470 | + $config = apply_filters('FHEE__EE_messenger__get_validator_config', $config, $this); |
|
471 | 471 | return $config; |
472 | 472 | } |
473 | 473 | |
@@ -484,8 +484,8 @@ discard block |
||
484 | 484 | * @access public |
485 | 485 | * @return string content for page |
486 | 486 | */ |
487 | - public function get_messenger_admin_page_content( $page, $action = null, $extra = array(), $message_types = array() ) { |
|
488 | - return $this->_get_admin_page_content( $page, $action, $extra, $message_types ); |
|
487 | + public function get_messenger_admin_page_content($page, $action = null, $extra = array(), $message_types = array()) { |
|
488 | + return $this->_get_admin_page_content($page, $action, $extra, $message_types); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | |
@@ -495,20 +495,20 @@ discard block |
||
495 | 495 | * @param array $extra |
496 | 496 | * @return mixed|string |
497 | 497 | */ |
498 | - protected function _get_admin_content_events_edit( $message_types, $extra ) { |
|
498 | + protected function _get_admin_content_events_edit($message_types, $extra) { |
|
499 | 499 | //defaults |
500 | 500 | $template_args = array(); |
501 | 501 | $selector_rows = ''; |
502 | 502 | |
503 | 503 | //we don't need message types here so we're just going to ignore. we do, however, expect the event id here. The event id is needed to provide a link to setup a custom template for this event. |
504 | - $event_id = isset( $extra['event'] ) ? $extra['event'] : NULL; |
|
504 | + $event_id = isset($extra['event']) ? $extra['event'] : NULL; |
|
505 | 505 | |
506 | - $template_wrapper_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_wrapper.template.php'; |
|
507 | - $template_row_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_row.template.php'; |
|
506 | + $template_wrapper_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_wrapper.template.php'; |
|
507 | + $template_row_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_row.template.php'; |
|
508 | 508 | |
509 | 509 | //array of template objects for global and custom (non-trashed) (but remember just for this messenger!) |
510 | 510 | $global_templates = EEM_Message_Template_Group::instance()->get_all( |
511 | - array( array( 'MTP_messenger' => $this->name, 'MTP_is_global' => true, 'MTP_is_active' => true ) ) |
|
511 | + array(array('MTP_messenger' => $this->name, 'MTP_is_global' => true, 'MTP_is_active' => true)) |
|
512 | 512 | ); |
513 | 513 | $templates_for_event = EEM_Message_Template_Group::instance()->get_all_custom_templates_by_event( |
514 | 514 | $event_id, |
@@ -517,55 +517,55 @@ discard block |
||
517 | 517 | 'MTP_is_active' => true |
518 | 518 | ) |
519 | 519 | ); |
520 | - $templates_for_event = !empty( $templates_for_event ) ? $templates_for_event : array(); |
|
520 | + $templates_for_event = ! empty($templates_for_event) ? $templates_for_event : array(); |
|
521 | 521 | |
522 | 522 | //so we need to setup the rows for the selectors and we use the global mtpgs (cause those will the active message template groups) |
523 | - foreach ( $global_templates as $mtpgID => $mtpg ) { |
|
524 | - if ( $mtpg instanceof EE_Message_Template_Group ) { |
|
523 | + foreach ($global_templates as $mtpgID => $mtpg) { |
|
524 | + if ($mtpg instanceof EE_Message_Template_Group) { |
|
525 | 525 | //verify this message type is supposed to show on this page |
526 | 526 | $mtp_obj = $mtpg->message_type_obj(); |
527 | - if ( ! $mtp_obj instanceof EE_message_type ) { |
|
527 | + if ( ! $mtp_obj instanceof EE_message_type) { |
|
528 | 528 | continue; |
529 | 529 | } |
530 | - $mtp_obj->admin_registered_pages = (array)$mtp_obj->admin_registered_pages; |
|
531 | - if ( ! in_array( 'events_edit', $mtp_obj->admin_registered_pages ) ) { |
|
530 | + $mtp_obj->admin_registered_pages = (array) $mtp_obj->admin_registered_pages; |
|
531 | + if ( ! in_array('events_edit', $mtp_obj->admin_registered_pages)) { |
|
532 | 532 | continue; |
533 | 533 | } |
534 | 534 | $select_values = array(); |
535 | - $select_values[ $mtpgID ] = __( 'Global', 'event_espresso' ); |
|
536 | - $default_value = array_key_exists( $mtpgID, $templates_for_event ) && ! $mtpg->get( 'MTP_is_override' ) ? $mtpgID : null; |
|
535 | + $select_values[$mtpgID] = __('Global', 'event_espresso'); |
|
536 | + $default_value = array_key_exists($mtpgID, $templates_for_event) && ! $mtpg->get('MTP_is_override') ? $mtpgID : null; |
|
537 | 537 | //if the override has been set for the global template, then that means even if there are custom templates already created we ignore them because of the set override. |
538 | - if ( ! $mtpg->get( 'MTP_is_override' ) ) { |
|
538 | + if ( ! $mtpg->get('MTP_is_override')) { |
|
539 | 539 | //any custom templates for this message type? |
540 | - $custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt( $this->name, $mtpg->message_type() ); |
|
541 | - foreach ( $custom_templates as $cmtpgID => $cmtpg ) { |
|
542 | - $select_values[ $cmtpgID ] = $cmtpg->name(); |
|
543 | - $default_value = array_key_exists( $cmtpgID, $templates_for_event ) ? $cmtpgID : $default_value; |
|
540 | + $custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt($this->name, $mtpg->message_type()); |
|
541 | + foreach ($custom_templates as $cmtpgID => $cmtpg) { |
|
542 | + $select_values[$cmtpgID] = $cmtpg->name(); |
|
543 | + $default_value = array_key_exists($cmtpgID, $templates_for_event) ? $cmtpgID : $default_value; |
|
544 | 544 | } |
545 | 545 | } |
546 | 546 | //if there is no $default_value then we set it as the global |
547 | - $default_value = empty( $default_value ) ? $mtpgID : $default_value; |
|
548 | - $edit_url = EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value ), admin_url( 'admin.php' ) ); |
|
549 | - $create_url = EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value ), admin_url( 'admin.php' ) ); |
|
550 | - $st_args[ 'mt_name' ] = ucwords( $mtp_obj->label[ 'singular' ] ); |
|
551 | - $st_args[ 'mt_slug' ] = $mtpg->message_type(); |
|
552 | - $st_args[ 'messenger_slug' ] = $this->name; |
|
553 | - $st_args[ 'selector' ] = EEH_Form_Fields::select_input( 'event_message_templates_relation[' . $mtpgID . ']', $select_values, $default_value, 'data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '"', 'message-template-selector' ); |
|
547 | + $default_value = empty($default_value) ? $mtpgID : $default_value; |
|
548 | + $edit_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value), admin_url('admin.php')); |
|
549 | + $create_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value), admin_url('admin.php')); |
|
550 | + $st_args['mt_name'] = ucwords($mtp_obj->label['singular']); |
|
551 | + $st_args['mt_slug'] = $mtpg->message_type(); |
|
552 | + $st_args['messenger_slug'] = $this->name; |
|
553 | + $st_args['selector'] = EEH_Form_Fields::select_input('event_message_templates_relation['.$mtpgID.']', $select_values, $default_value, 'data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'"', 'message-template-selector'); |
|
554 | 554 | //note that message template group that has override_all_custom set will remove the ability to set a custom message template based off of the global (and that also in turn overrides any other custom templates). |
555 | - $st_args[ 'create_button' ] = $mtpg->get( 'MTP_is_override' ) ? '' : '<a data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $create_url . '" class="button button-small create-mtpg-button">' . __( 'Create New Custom', 'event_espresso' ) . '</a>'; |
|
556 | - $st_args[ 'create_button' ] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ? $st_args[ 'create_button' ] : ''; |
|
557 | - $st_args[ 'edit_button' ] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID ) ? '<a data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $edit_url . '" class="button button-small edit-mtpg-button">' . __( 'Edit', 'event_espresso' ) . '</a>' : ''; |
|
558 | - $selector_rows .= EEH_Template::display_template( $template_row_path, $st_args, true ); |
|
555 | + $st_args['create_button'] = $mtpg->get('MTP_is_override') ? '' : '<a data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$create_url.'" class="button button-small create-mtpg-button">'.__('Create New Custom', 'event_espresso').'</a>'; |
|
556 | + $st_args['create_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template') ? $st_args['create_button'] : ''; |
|
557 | + $st_args['edit_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID) ? '<a data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$edit_url.'" class="button button-small edit-mtpg-button">'.__('Edit', 'event_espresso').'</a>' : ''; |
|
558 | + $selector_rows .= EEH_Template::display_template($template_row_path, $st_args, true); |
|
559 | 559 | } |
560 | 560 | } |
561 | 561 | |
562 | 562 | //if no selectors present then get out. |
563 | - if ( empty( $selector_rows ) ) { |
|
563 | + if (empty($selector_rows)) { |
|
564 | 564 | return ''; |
565 | 565 | } |
566 | 566 | |
567 | 567 | $template_args['selector_rows'] = $selector_rows; |
568 | - return EEH_Template::display_template( $template_wrapper_path, $template_args, TRUE ); |
|
568 | + return EEH_Template::display_template($template_wrapper_path, $template_args, TRUE); |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | |
@@ -580,8 +580,8 @@ discard block |
||
580 | 580 | * @return array $this->_template_fields |
581 | 581 | */ |
582 | 582 | public function get_template_fields() { |
583 | - $template_fields = apply_filters( 'FHEE__' . get_class($this) . '__get_template_fields', $this->_template_fields, $this ); |
|
584 | - $template_fields = apply_filters( 'FHEE__EE_messenger__get_template_fields', $template_fields, $this ); |
|
583 | + $template_fields = apply_filters('FHEE__'.get_class($this).'__get_template_fields', $this->_template_fields, $this); |
|
584 | + $template_fields = apply_filters('FHEE__EE_messenger__get_template_fields', $template_fields, $this); |
|
585 | 585 | return $template_fields; |
586 | 586 | } |
587 | 587 | |
@@ -595,9 +595,9 @@ discard block |
||
595 | 595 | * @param mixed $value |
596 | 596 | */ |
597 | 597 | protected function _set_template_value($item, $value) { |
598 | - if ( array_key_exists($item, $this->_template_fields) ) { |
|
599 | - $prop = '_' . $item; |
|
600 | - $this->{$prop}= $value; |
|
598 | + if (array_key_exists($item, $this->_template_fields)) { |
|
599 | + $prop = '_'.$item; |
|
600 | + $this->{$prop} = $value; |
|
601 | 601 | } |
602 | 602 | } |
603 | 603 | |
@@ -615,18 +615,18 @@ discard block |
||
615 | 615 | * |
616 | 616 | * @throws SendMessageException |
617 | 617 | */ |
618 | - final public function send_message( $message, EE_message_type $message_type ) { |
|
618 | + final public function send_message($message, EE_message_type $message_type) { |
|
619 | 619 | try { |
620 | - $this->_validate_and_setup( $message ); |
|
620 | + $this->_validate_and_setup($message); |
|
621 | 621 | $this->_incoming_message_type = $message_type; |
622 | 622 | $response = $this->_send_message(); |
623 | - if ( $response instanceof WP_Error ) { |
|
624 | - EE_Error::add_error( $response->get_error_message(), __FILE__, __FUNCTION__, __LINE__ ); |
|
623 | + if ($response instanceof WP_Error) { |
|
624 | + EE_Error::add_error($response->get_error_message(), __FILE__, __FUNCTION__, __LINE__); |
|
625 | 625 | $response = false; |
626 | 626 | } |
627 | - } catch ( \Exception $e ) { |
|
627 | + } catch (\Exception $e) { |
|
628 | 628 | //convert to an instance of SendMessageException |
629 | - throw new SendMessageException( $e->getMessage() ); |
|
629 | + throw new SendMessageException($e->getMessage()); |
|
630 | 630 | } |
631 | 631 | return $response; |
632 | 632 | } |
@@ -640,28 +640,28 @@ discard block |
||
640 | 640 | * @param bool $send true we will actually use the _send method (for test sends). FALSE we just return preview |
641 | 641 | * @return string return the message html content |
642 | 642 | */ |
643 | - public function get_preview( EE_Message $message, EE_message_type $message_type, $send = false ) { |
|
644 | - $this->_validate_and_setup( $message ); |
|
643 | + public function get_preview(EE_Message $message, EE_message_type $message_type, $send = false) { |
|
644 | + $this->_validate_and_setup($message); |
|
645 | 645 | |
646 | 646 | $this->_incoming_message_type = $message_type; |
647 | 647 | |
648 | - if ( $send ) { |
|
648 | + if ($send) { |
|
649 | 649 | //are we overriding any existing template fields? |
650 | 650 | $settings = $this->get_existing_test_settings(); |
651 | - if ( ! empty( $settings ) ) { |
|
652 | - foreach ( $settings as $field => $value ) { |
|
653 | - $this->_set_template_value( $field, $value ); |
|
651 | + if ( ! empty($settings)) { |
|
652 | + foreach ($settings as $field => $value) { |
|
653 | + $this->_set_template_value($field, $value); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | } |
657 | 657 | |
658 | 658 | //enqueue preview js so that any links/buttons on the page are disabled. |
659 | - if ( ! $send ) { |
|
659 | + if ( ! $send) { |
|
660 | 660 | // the below may seem like duplication. However, typically if a messenger enqueues scripts/styles, |
661 | 661 | // it deregisters all existing wp scripts and styles first. So the second hook ensures our previewer still gets setup. |
662 | - add_action( 'admin_enqueue_scripts', array( $this, 'add_preview_script' ), 10 ); |
|
663 | - add_action( 'wp_enqueue_scripts', array( $this, 'add_preview_script' ), 10 ); |
|
664 | - add_action( 'AHEE__EE_messenger__enqueue_scripts_styles', array( $this, 'add_preview_script' ), 10 ); |
|
662 | + add_action('admin_enqueue_scripts', array($this, 'add_preview_script'), 10); |
|
663 | + add_action('wp_enqueue_scripts', array($this, 'add_preview_script'), 10); |
|
664 | + add_action('AHEE__EE_messenger__enqueue_scripts_styles', array($this, 'add_preview_script'), 10); |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | return $send ? $this->_send_message() : $this->_preview(); |
@@ -679,10 +679,10 @@ discard block |
||
679 | 679 | */ |
680 | 680 | public function add_preview_script() { |
681 | 681 | //error message |
682 | - EE_Registry::$i18n_js_strings[ 'links_disabled' ] = __( 'All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup. To test generated links, you must trigger an actual message notification.', 'event_espresso' ); |
|
683 | - wp_register_script( 'ee-messages-preview-js', EE_LIBRARIES_URL . 'messages/messenger/assets/js/ee-messages-preview.js', array( 'jquery' ), EVENT_ESPRESSO_VERSION, true ); |
|
684 | - wp_localize_script( 'ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
685 | - wp_enqueue_script( 'ee-messages-preview-js' ); |
|
682 | + EE_Registry::$i18n_js_strings['links_disabled'] = __('All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup. To test generated links, you must trigger an actual message notification.', 'event_espresso'); |
|
683 | + wp_register_script('ee-messages-preview-js', EE_LIBRARIES_URL.'messages/messenger/assets/js/ee-messages-preview.js', array('jquery'), EVENT_ESPRESSO_VERSION, true); |
|
684 | + wp_localize_script('ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings); |
|
685 | + wp_enqueue_script('ee-messages-preview-js'); |
|
686 | 686 | } |
687 | 687 | |
688 | 688 | |
@@ -693,13 +693,13 @@ discard block |
||
693 | 693 | * @param EE_Message $message |
694 | 694 | * @throws EE_Error |
695 | 695 | */ |
696 | - protected function _validate_and_setup( EE_Message $message ) { |
|
696 | + protected function _validate_and_setup(EE_Message $message) { |
|
697 | 697 | $template_pack = $message->get_template_pack(); |
698 | 698 | $variation = $message->get_template_pack_variation(); |
699 | 699 | |
700 | 700 | //verify we have the required template pack value on the $message object. |
701 | - if ( ! $template_pack instanceof EE_Messages_Template_Pack ) { |
|
702 | - throw new EE_Error( __('Incoming $message object must have an EE_Messages_Template_Pack object available.', 'event_espresso' ) ); |
|
701 | + if ( ! $template_pack instanceof EE_Messages_Template_Pack) { |
|
702 | + throw new EE_Error(__('Incoming $message object must have an EE_Messages_Template_Pack object available.', 'event_espresso')); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | $this->_tmp_pack = $template_pack; |
@@ -708,11 +708,11 @@ discard block |
||
708 | 708 | |
709 | 709 | $template_fields = $this->get_template_fields(); |
710 | 710 | |
711 | - foreach ( $template_fields as $template => $value ) { |
|
712 | - if ( $template !== 'extra' ) { |
|
713 | - $column_value = $message->get_field_or_extra_meta( 'MSG_' . $template ); |
|
711 | + foreach ($template_fields as $template => $value) { |
|
712 | + if ($template !== 'extra') { |
|
713 | + $column_value = $message->get_field_or_extra_meta('MSG_'.$template); |
|
714 | 714 | $message_template_value = $column_value ? $column_value : null; |
715 | - $this->_set_template_value( $template, $message_template_value ); |
|
715 | + $this->_set_template_value($template, $message_template_value); |
|
716 | 716 | } |
717 | 717 | } |
718 | 718 | } |
@@ -727,19 +727,19 @@ discard block |
||
727 | 727 | * @return string |
728 | 728 | * @throws \EE_Error |
729 | 729 | */ |
730 | - protected function _get_main_template( $preview = FALSE ) { |
|
730 | + protected function _get_main_template($preview = FALSE) { |
|
731 | 731 | $type = $preview ? 'preview' : 'main'; |
732 | 732 | |
733 | - $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type ); |
|
733 | + $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, $type); |
|
734 | 734 | |
735 | 735 | //check file exists and is readable |
736 | - if ( !is_readable( $wrapper_template ) ) |
|
737 | - throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
736 | + if ( ! is_readable($wrapper_template)) |
|
737 | + throw new EE_Error(sprintf(__('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso'), ucwords($this->label['singular']), $wrapper_template)); |
|
738 | 738 | |
739 | 739 | //add message type to template args |
740 | 740 | $this->_template_args['message_type'] = $this->_incoming_message_type; |
741 | 741 | |
742 | - return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE ); |
|
742 | + return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE); |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | |
@@ -775,9 +775,9 @@ discard block |
||
775 | 775 | */ |
776 | 776 | public function get_existing_test_settings() { |
777 | 777 | /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
778 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
778 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
779 | 779 | $settings = $Message_Resource_Manager->get_active_messengers_option(); |
780 | - return isset( $settings[ $this->name ]['test_settings'] ) ? $settings[ $this->name ]['test_settings'] : array(); |
|
780 | + return isset($settings[$this->name]['test_settings']) ? $settings[$this->name]['test_settings'] : array(); |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | |
@@ -789,12 +789,12 @@ discard block |
||
789 | 789 | * @param $settings |
790 | 790 | * @return bool success/fail |
791 | 791 | */ |
792 | - public function set_existing_test_settings( $settings ) { |
|
792 | + public function set_existing_test_settings($settings) { |
|
793 | 793 | /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
794 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
794 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
795 | 795 | $existing = $Message_Resource_Manager->get_active_messengers_option(); |
796 | - $existing[ $this->name ]['test_settings'] = $settings; |
|
797 | - return $Message_Resource_Manager->update_active_messengers_option( $existing ); |
|
796 | + $existing[$this->name]['test_settings'] = $settings; |
|
797 | + return $Message_Resource_Manager->update_active_messengers_option($existing); |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | |
@@ -807,21 +807,21 @@ discard block |
||
807 | 807 | * @param string $field The field to retrieve the label for |
808 | 808 | * @return string The label |
809 | 809 | */ |
810 | - public function get_field_label( $field ) { |
|
810 | + public function get_field_label($field) { |
|
811 | 811 | //first let's see if the field requests is in the top level array. |
812 | - if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) |
|
812 | + if (isset($this->_template_fields[$field]) && ! empty($this->_template_fields[$field]['label'])) |
|
813 | 813 | return $this->_template[$field]['label']; |
814 | 814 | |
815 | 815 | //nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index. |
816 | - if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) |
|
816 | + if (isset($this->_template_fields['extra']) && ! empty($this->_template_fields['extra'][$field]) && ! empty($this->_template_fields['extra'][$field]['main']['label'])) |
|
817 | 817 | return $this->_template_fields['extra'][$field]['main']['label']; |
818 | 818 | |
819 | 819 | //now it's possible this field may just be existing in any of the extra array items. |
820 | - if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) { |
|
821 | - foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) { |
|
822 | - if ( !is_array( $subfields ) ) |
|
820 | + if ( ! empty($this->_template_fields['extra']) && is_array($this->_template_fields['extra'])) { |
|
821 | + foreach ($this->_template_fields['extra'] as $main_field => $subfields) { |
|
822 | + if ( ! is_array($subfields)) |
|
823 | 823 | continue; |
824 | - if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) |
|
824 | + if (isset($subfields[$field]) && ! empty($subfields[$field]['label'])) |
|
825 | 825 | return $subfields[$field]['label']; |
826 | 826 | } |
827 | 827 | } |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | * |
843 | 843 | * @return void |
844 | 844 | */ |
845 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
845 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
846 | 846 | return; |
847 | 847 | } |
848 | 848 |
@@ -1,8 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use \EventEspresso\core\exceptions\SendMessageException; |
3 | 3 | |
4 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
4 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
5 | 5 | exit('NO direct script access allowed'); |
6 | +} |
|
6 | 7 | |
7 | 8 | /** |
8 | 9 | * EE_messenger class |
@@ -733,8 +734,9 @@ discard block |
||
733 | 734 | $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type ); |
734 | 735 | |
735 | 736 | //check file exists and is readable |
736 | - if ( !is_readable( $wrapper_template ) ) |
|
737 | - throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
737 | + if ( !is_readable( $wrapper_template ) ) { |
|
738 | + throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
739 | + } |
|
738 | 740 | |
739 | 741 | //add message type to template args |
740 | 742 | $this->_template_args['message_type'] = $this->_incoming_message_type; |
@@ -809,20 +811,24 @@ discard block |
||
809 | 811 | */ |
810 | 812 | public function get_field_label( $field ) { |
811 | 813 | //first let's see if the field requests is in the top level array. |
812 | - if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) |
|
813 | - return $this->_template[$field]['label']; |
|
814 | + if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) { |
|
815 | + return $this->_template[$field]['label']; |
|
816 | + } |
|
814 | 817 | |
815 | 818 | //nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index. |
816 | - if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) |
|
817 | - return $this->_template_fields['extra'][$field]['main']['label']; |
|
819 | + if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) { |
|
820 | + return $this->_template_fields['extra'][$field]['main']['label']; |
|
821 | + } |
|
818 | 822 | |
819 | 823 | //now it's possible this field may just be existing in any of the extra array items. |
820 | 824 | if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) { |
821 | 825 | foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) { |
822 | - if ( !is_array( $subfields ) ) |
|
823 | - continue; |
|
824 | - if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) |
|
825 | - return $subfields[$field]['label']; |
|
826 | + if ( !is_array( $subfields ) ) { |
|
827 | + continue; |
|
828 | + } |
|
829 | + if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) { |
|
830 | + return $subfields[$field]['label']; |
|
831 | + } |
|
826 | 832 | } |
827 | 833 | } |
828 | 834 |
@@ -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 | * Event Espresso |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <tr> |
29 | - <th><h3><?php _e("Invoice Gateway Settings", 'event_espresso');?></h3></th> |
|
29 | + <th><h3><?php _e("Invoice Gateway Settings", 'event_espresso'); ?></h3></th> |
|
30 | 30 | <td> |
31 | - <span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso');?></span> |
|
31 | + <span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso'); ?></span> |
|
32 | 32 | </td> |
33 | 33 | </tr> |
34 | 34 | <?php |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * invoice_settings_header_gateway |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * invoice_settings_header_gateway |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <tr> |
29 | 29 | <th><h3><?php _e("Invoice Gateway Settings", 'event_espresso');?></h3></th> |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | /** |
6 | 7 | * Event Espresso |
7 | 8 | * |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | 6 | * Event Espresso |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <tr> |
29 | - <th><h3><?php _e("Invoice Display Settings", 'event_espresso');?></h3></th> |
|
29 | + <th><h3><?php _e("Invoice Display Settings", 'event_espresso'); ?></h3></th> |
|
30 | 30 | <td> |
31 | - <span class="description"><?php _e("The following settings affect the content and/or appearance of the downloadable PDF invoice.", 'event_espresso');?></span> |
|
31 | + <span class="description"><?php _e("The following settings affect the content and/or appearance of the downloadable PDF invoice.", 'event_espresso'); ?></span> |
|
32 | 32 | </td> |
33 | 33 | </tr> |
34 | 34 | <?php |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * invoice_settings_header_display |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * invoice_settings_header_display |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <tr> |
29 | 29 | <th><h3><?php _e("Invoice Display Settings", 'event_espresso');?></h3></th> |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | /** |
6 | 7 | * Event Espresso |
7 | 8 | * |
@@ -200,7 +200,7 @@ |
||
200 | 200 | * generates an EE_Message using the supplied arguments and some defaults |
201 | 201 | * |
202 | 202 | * @param array $properties |
203 | - * @return string |
|
203 | + * @return EE_Message |
|
204 | 204 | */ |
205 | 205 | protected function _generate_message( $properties = array() ) { |
206 | 206 | $message = EE_Message_Factory::create( |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | public function __construct( |
106 | 106 | $messenger_name, |
107 | 107 | $message_type_name, |
108 | - $data = array(), |
|
108 | + $data = array(), |
|
109 | 109 | $context = '', |
110 | 110 | $preview = false, |
111 | 111 | $status = EEM_Message::status_incomplete |
112 | 112 | ) { |
113 | - $this->_messenger_name = $messenger_name; |
|
114 | - $this->_message_type_name = $message_type_name; |
|
115 | - $this->_data = is_array( $data ) ? $data : array( $data ); |
|
113 | + $this->_messenger_name = $messenger_name; |
|
114 | + $this->_message_type_name = $message_type_name; |
|
115 | + $this->_data = is_array($data) ? $data : array($data); |
|
116 | 116 | $this->_context = $context; |
117 | 117 | $this->_preview = $preview; |
118 | 118 | $this->_status = $status; |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | /** |
171 | 171 | * @param boolean $preview |
172 | 172 | */ |
173 | - public function set_preview( $preview ) { |
|
174 | - $this->_preview = filter_var( $preview, FILTER_VALIDATE_BOOLEAN ); |
|
173 | + public function set_preview($preview) { |
|
174 | + $this->_preview = filter_var($preview, FILTER_VALIDATE_BOOLEAN); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @param array $properties |
203 | 203 | * @return string |
204 | 204 | */ |
205 | - protected function _generate_message( $properties = array() ) { |
|
205 | + protected function _generate_message($properties = array()) { |
|
206 | 206 | $message = EE_Message_Factory::create( |
207 | 207 | array_merge( |
208 | 208 | array( |
@@ -216,12 +216,12 @@ discard block |
||
216 | 216 | ); |
217 | 217 | // validate the message, and if it's good, set some properties |
218 | 218 | try { |
219 | - $message->is_valid_for_sending_or_generation( true ); |
|
219 | + $message->is_valid_for_sending_or_generation(true); |
|
220 | 220 | $this->_valid = true; |
221 | 221 | $this->_messenger = $message->messenger_object(); |
222 | 222 | $this->_message_type = $message->message_type_object(); |
223 | 223 | $this->_send_now = $message->send_now(); |
224 | - } catch ( Exception $e ) { |
|
224 | + } catch (Exception $e) { |
|
225 | 225 | $this->_valid = false; |
226 | 226 | $this->_error_msg[] = $e->getMessage(); |
227 | 227 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function get_EE_Message() { |
239 | 239 | // already set ? |
240 | - if ( $this->_message instanceof EE_Message ) { |
|
240 | + if ($this->_message instanceof EE_Message) { |
|
241 | 241 | return $this->_message; |
242 | 242 | } |
243 | 243 | // no? then let's create one |
@@ -255,15 +255,15 @@ discard block |
||
255 | 255 | * @param bool $preview Used to indicate that the preview data handler is to be returned. |
256 | 256 | * @return string |
257 | 257 | */ |
258 | - public function get_data_handler_class_name( $preview = false ) { |
|
259 | - if ( $this->_data_handler_class_name === '' && $this->valid() ) { |
|
260 | - $ref = $preview ? 'Preview' : $this->_message_type->get_data_handler( $this->_data ); |
|
258 | + public function get_data_handler_class_name($preview = false) { |
|
259 | + if ($this->_data_handler_class_name === '' && $this->valid()) { |
|
260 | + $ref = $preview ? 'Preview' : $this->_message_type->get_data_handler($this->_data); |
|
261 | 261 | //make sure internal data is updated. |
262 | 262 | $this->_data = $this->_message_type->get_data(); |
263 | 263 | |
264 | 264 | //verify |
265 | - $this->_data_handler_class_name = EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference( $ref ); |
|
266 | - if ( $this->_data_handler_class_name === '' ) { |
|
265 | + $this->_data_handler_class_name = EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference($ref); |
|
266 | + if ($this->_data_handler_class_name === '') { |
|
267 | 267 | $this->_valid = false; |
268 | 268 | } |
269 | 269 | } |
@@ -279,9 +279,9 @@ discard block |
||
279 | 279 | * @param string $data_handler_reference |
280 | 280 | * @return string |
281 | 281 | */ |
282 | - public static function verify_and_retrieve_class_name_for_data_handler_reference( $data_handler_reference ) { |
|
283 | - $class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data'; |
|
284 | - if ( ! class_exists( $class_name ) ) { |
|
282 | + public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference) { |
|
283 | + $class_name = 'EE_Messages_'.$data_handler_reference.'_incoming_data'; |
|
284 | + if ( ! class_exists($class_name)) { |
|
285 | 285 | EE_Error::add_error( |
286 | 286 | sprintf( |
287 | 287 | __( |
@@ -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 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Pending_Approval_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'pending_approval'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
48 | 48 | 'required' => array('[EVENT_LIST]') |
49 | 49 | ); |
50 | - $this->_messenger->set_validator_config( $new_config ); |
|
50 | + $this->_messenger->set_validator_config($new_config); |
|
51 | 51 | |
52 | - if ( $this->_context != 'admin' ) |
|
52 | + if ($this->_context != 'admin') |
|
53 | 53 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
54 | 54 | |
55 | 55 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -55,8 +56,9 @@ discard block |
||
55 | 56 | ); |
56 | 57 | $this->_messenger->set_validator_config( $new_config ); |
57 | 58 | |
58 | - if ( $this->_context != 'admin' ) |
|
59 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
59 | + if ( $this->_context != 'admin' ) { |
|
60 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
62 | 64 | } |
@@ -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 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Not_Approved_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'not_approved_registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
47 | 47 | 'required' => array('[EVENT_LIST]') |
48 | 48 | ); |
49 | - $this->_messenger->set_validator_config( $new_config ); |
|
49 | + $this->_messenger->set_validator_config($new_config); |
|
50 | 50 | |
51 | - if ( $this->_context != 'admin' ) |
|
51 | + if ($this->_context != 'admin') |
|
52 | 52 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
53 | 53 | |
54 | 54 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -55,8 +56,9 @@ discard block |
||
55 | 56 | ); |
56 | 57 | $this->_messenger->set_validator_config( $new_config ); |
57 | 58 | |
58 | - if ( $this->_context != 'admin' ) |
|
59 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
59 | + if ( $this->_context != 'admin' ) { |
|
60 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
62 | 64 | } |
@@ -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 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
48 | 48 | 'required' => array('[EVENT_LIST]') |
49 | 49 | ); |
50 | - $this->_messenger->set_validator_config( $new_config ); |
|
50 | + $this->_messenger->set_validator_config($new_config); |
|
51 | 51 | |
52 | - if ( $this->_context != 'admin' ) |
|
52 | + if ($this->_context != 'admin') |
|
53 | 53 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
54 | 54 | |
55 | 55 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -55,8 +56,9 @@ discard block |
||
55 | 56 | ); |
56 | 57 | $this->_messenger->set_validator_config( $new_config ); |
57 | 58 | |
58 | - if ( $this->_context != 'admin' ) |
|
59 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
59 | + if ( $this->_context != 'admin' ) { |
|
60 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
62 | 64 | } |
@@ -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 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Payment_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'payment'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | //modify just event_list |
47 | 47 | $new_config['event_list'] = array( |
48 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
48 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
49 | 49 | ); |
50 | 50 | $new_config['ticket_list'] = array( |
51 | 51 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
52 | 52 | ); |
53 | 53 | $new_config['content'] = array( |
54 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
54 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
55 | 55 | ); |
56 | - $this->_messenger->set_validator_config( $new_config ); |
|
56 | + $this->_messenger->set_validator_config($new_config); |
|
57 | 57 | |
58 | - if ( $this->_context != 'admin' ) |
|
58 | + if ($this->_context != 'admin') |
|
59 | 59 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
60 | 60 | |
61 | 61 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -55,8 +56,9 @@ discard block |
||
55 | 56 | ); |
56 | 57 | $this->_messenger->set_validator_config( $new_config ); |
57 | 58 | |
58 | - if ( $this->_context != 'admin' ) |
|
59 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
59 | + if ( $this->_context != 'admin' ) { |
|
60 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
62 | 64 | } |
@@ -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 | /** |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | class EE_Messages_Email_Registration_Summary_Validator extends EE_Messages_Validator { |
19 | 19 | |
20 | 20 | |
21 | - public function __construct( $fields, $context ) { |
|
21 | + public function __construct($fields, $context) { |
|
22 | 22 | $this->_m_name = 'email'; |
23 | 23 | $this->_mt_name = 'registration_summary'; |
24 | 24 | |
25 | - parent::__construct( $fields, $context ); |
|
25 | + parent::__construct($fields, $context); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
36 | 36 | 'required' => array('[EVENT_LIST]') |
37 | 37 | ); |
38 | - $this->_messenger->set_validator_config( $new_config ); |
|
38 | + $this->_messenger->set_validator_config($new_config); |
|
39 | 39 | |
40 | - if ( $this->_context != 'admin' ) |
|
40 | + if ($this->_context != 'admin') |
|
41 | 41 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
42 | 42 | |
43 | 43 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * |
@@ -37,8 +38,9 @@ discard block |
||
37 | 38 | ); |
38 | 39 | $this->_messenger->set_validator_config( $new_config ); |
39 | 40 | |
40 | - if ( $this->_context != 'admin' ) |
|
41 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + if ( $this->_context != 'admin' ) { |
|
42 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
43 | + } |
|
42 | 44 | |
43 | 45 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
44 | 46 | } |