@@ -1,6 +1,6 @@ |
||
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 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ |
||
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 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -93,7 +93,7 @@ |
||
93 | 93 | * |
94 | 94 | * @abstract |
95 | 95 | * @access protected |
96 | - * @return array |
|
96 | + * @return string[] |
|
97 | 97 | */ |
98 | 98 | protected function _get_table_filters() { |
99 | 99 | $filters = array(); |
@@ -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 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * This sets up the email messenger for the EE_messages (notifications) subsystem in EE. |
31 | 31 | */ |
32 | -class EE_Email_messenger extends EE_messenger { |
|
32 | +class EE_Email_messenger extends EE_messenger { |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * The following are the properties that email requires for the message going out. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | protected function _set_valid_shortcodes() { |
76 | 76 | //remember by leaving the other fields not set, those fields will inherit the valid shortcodes from the message type. |
77 | 77 | $this->_valid_shortcodes = array( |
78 | - 'to' => array('email','event_author', 'primary_registration_details', 'recipient_details'), |
|
78 | + 'to' => array('email', 'event_author', 'primary_registration_details', 'recipient_details'), |
|
79 | 79 | 'from' => array('email', 'event_author', 'primary_registration_details', 'recipient_details') |
80 | 80 | ); |
81 | 81 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'shortcodes' => array('organization', 'primary_registration_details', 'event_author', 'primary_registration_details', 'recipient_details') |
110 | 110 | ), |
111 | 111 | 'content' => array( |
112 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger') |
|
112 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger') |
|
113 | 113 | ), |
114 | 114 | 'attendee_list' => array( |
115 | 115 | 'shortcodes' => array('attendee', 'event_list', 'ticket_list'), |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'required' => array('[EVENT_LIST]') |
121 | 121 | ), |
122 | 122 | 'ticket_list' => array( |
123 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'), |
|
123 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'), |
|
124 | 124 | 'required' => array('[TICKET_LIST]') |
125 | 125 | ), |
126 | 126 | 'datetime_list' => array( |
@@ -139,21 +139,21 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @since 4.5.0 |
141 | 141 | */ |
142 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
143 | - if ( $sending_messenger_name = 'html' ) { |
|
144 | - add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 ); |
|
142 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
143 | + if ($sending_messenger_name = 'html') { |
|
144 | + add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | 150 | |
151 | - public function add_email_css( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) { |
|
151 | + public function add_email_css($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) { |
|
152 | 152 | //prevent recursion on this callback. |
153 | - remove_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10 ); |
|
154 | - $variation = $this->get_variation( $template_pack, $message_type, $url, 'main', $variation, FALSE ); |
|
153 | + remove_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10); |
|
154 | + $variation = $this->get_variation($template_pack, $message_type, $url, 'main', $variation, FALSE); |
|
155 | 155 | |
156 | - add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 ); |
|
156 | + add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8); |
|
157 | 157 | return $variation; |
158 | 158 | } |
159 | 159 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | 'required' => FALSE, |
186 | 186 | 'validation' => FALSE, |
187 | 187 | 'format' => '%s', |
188 | - 'value' => sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ), |
|
188 | + 'value' => sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')), |
|
189 | 189 | 'default'=> '', |
190 | 190 | 'css_class' => '' |
191 | 191 | ) |
@@ -348,8 +348,8 @@ discard block |
||
348 | 348 | */ |
349 | 349 | protected function _send_message() { |
350 | 350 | return wp_mail( |
351 | - html_entity_decode( $this->_to, ENT_QUOTES, "UTF-8" ), |
|
352 | - stripslashes( html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8" )), |
|
351 | + html_entity_decode($this->_to, ENT_QUOTES, "UTF-8"), |
|
352 | + stripslashes(html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8")), |
|
353 | 353 | $this->_body(), |
354 | 354 | $this->_headers() |
355 | 355 | ); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | * @return string html body of the message content and the related css. |
364 | 364 | */ |
365 | 365 | protected function _preview() { |
366 | - return $this->_body( TRUE ); |
|
366 | + return $this->_body(TRUE); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | |
@@ -377,18 +377,18 @@ discard block |
||
377 | 377 | * @return string formatted header for email |
378 | 378 | */ |
379 | 379 | protected function _headers() { |
380 | - $from = stripslashes_deep( html_entity_decode($this->_from, ENT_QUOTES,"UTF-8" ) ); |
|
380 | + $from = stripslashes_deep(html_entity_decode($this->_from, ENT_QUOTES, "UTF-8")); |
|
381 | 381 | $headers = array( |
382 | 382 | 'MIME-Version: 1.0', |
383 | - 'From:' . $from, |
|
384 | - 'Reply-To:' . $from, |
|
383 | + 'From:'.$from, |
|
384 | + 'Reply-To:'.$from, |
|
385 | 385 | 'Content-Type:text/html; charset=utf-8' |
386 | 386 | ); |
387 | 387 | |
388 | 388 | //but wait! Header's for the from is NOT reliable because some plugins don't respect From: as set in the header. |
389 | - add_filter( 'wp_mail_from', array( $this, 'set_from_address' ), 100 ); |
|
390 | - add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ), 100 ); |
|
391 | - return apply_filters( 'FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this ); |
|
389 | + add_filter('wp_mail_from', array($this, 'set_from_address'), 100); |
|
390 | + add_filter('wp_mail_from_name', array($this, 'set_from_name'), 100); |
|
391 | + return apply_filters('FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | |
@@ -404,19 +404,19 @@ discard block |
||
404 | 404 | * @return array |
405 | 405 | */ |
406 | 406 | private function _parse_from() { |
407 | - if ( strpos( $this->_from, '<' ) !== false ) { |
|
408 | - $from_name = substr( $this->_from, 0, strpos( $this->_from, '<' ) - 1 ); |
|
409 | - $from_name = str_replace( '"', '', $from_name ); |
|
410 | - $from_name = trim( $from_name ); |
|
411 | - |
|
412 | - $from_email = substr( $this->_from, strpos( $this->_from, '<' ) + 1 ); |
|
413 | - $from_email = str_replace( '>', '', $from_email ); |
|
414 | - $from_email = trim( $from_email ); |
|
407 | + if (strpos($this->_from, '<') !== false) { |
|
408 | + $from_name = substr($this->_from, 0, strpos($this->_from, '<') - 1); |
|
409 | + $from_name = str_replace('"', '', $from_name); |
|
410 | + $from_name = trim($from_name); |
|
411 | + |
|
412 | + $from_email = substr($this->_from, strpos($this->_from, '<') + 1); |
|
413 | + $from_email = str_replace('>', '', $from_email); |
|
414 | + $from_email = trim($from_email); |
|
415 | 415 | } else { |
416 | 416 | $from_name = ''; |
417 | - $from_email = trim( $this->_from ); |
|
417 | + $from_email = trim($this->_from); |
|
418 | 418 | } |
419 | - return array( $from_name, $from_email ); |
|
419 | + return array($from_name, $from_email); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | * |
430 | 430 | * @param string $from_email What the original from_email is. |
431 | 431 | */ |
432 | - public function set_from_address( $from_email ) { |
|
432 | + public function set_from_address($from_email) { |
|
433 | 433 | $parsed_from = $this->_parse_from(); |
434 | 434 | return $parsed_from[1]; |
435 | 435 | } |
@@ -444,13 +444,13 @@ discard block |
||
444 | 444 | * |
445 | 445 | * @param string $from_name The original from_name. |
446 | 446 | */ |
447 | - public function set_from_name( $from_name ) { |
|
447 | + public function set_from_name($from_name) { |
|
448 | 448 | $parsed_from = $this->_parse_from(); |
449 | - if ( is_array( $parsed_from) && ! empty( $parsed_from[0] ) ) { |
|
450 | - $from_name = $parsed_from[0]; |
|
449 | + if (is_array($parsed_from) && ! empty($parsed_from[0])) { |
|
450 | + $from_name = $parsed_from[0]; |
|
451 | 451 | } |
452 | 452 | |
453 | - return stripslashes_deep( html_entity_decode($from_name, ENT_QUOTES,"UTF-8" ) ); |
|
453 | + return stripslashes_deep(html_entity_decode($from_name, ENT_QUOTES, "UTF-8")); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | |
@@ -461,14 +461,14 @@ discard block |
||
461 | 461 | * @param bool $preview will determine whether this is preview template or not. |
462 | 462 | * @return string formatted body for email. |
463 | 463 | */ |
464 | - protected function _body( $preview = FALSE ) { |
|
464 | + protected function _body($preview = FALSE) { |
|
465 | 465 | //setup template args! |
466 | 466 | $this->_template_args = array( |
467 | 467 | 'subject' => $this->_subject, |
468 | 468 | 'from' => $this->_from, |
469 | - 'main_body' => wpautop(stripslashes_deep( html_entity_decode($this->_content, ENT_QUOTES,"UTF-8" ) )) |
|
469 | + 'main_body' => wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))) |
|
470 | 470 | ); |
471 | - $body = $this->_get_main_template( $preview ); |
|
471 | + $body = $this->_get_main_template($preview); |
|
472 | 472 | |
473 | 473 | /** |
474 | 474 | * This filter allows one to bypass the CSSToInlineStyles tool and leave the body untouched. |
@@ -476,17 +476,17 @@ discard block |
||
476 | 476 | * @type bool $preview Indicates whether a preview is being generated or not. |
477 | 477 | * @return bool true indicates to use the inliner, false bypasses it. |
478 | 478 | */ |
479 | - if ( apply_filters( 'FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview ) ) { |
|
479 | + if (apply_filters('FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview)) { |
|
480 | 480 | |
481 | 481 | //require CssToInlineStyles library and its dependencies via composer autoloader |
482 | - require_once EE_THIRD_PARTY . 'cssinliner/vendor/autoload.php'; |
|
482 | + require_once EE_THIRD_PARTY.'cssinliner/vendor/autoload.php'; |
|
483 | 483 | |
484 | 484 | //now if this isn't a preview, let's setup the body so it has inline styles |
485 | - if ( ! $preview || ( $preview && defined( 'DOING_AJAX' ) ) ) { |
|
486 | - $style = file_get_contents( $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation ), TRUE ); |
|
487 | - $CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles( $body, $style ); |
|
488 | - $body = ltrim( $CSS->convert( true ), ">\n" ); //for some reason the library has a bracket and new line at the beginning. This takes care of that. |
|
489 | - $body = ltrim( $body, "<?" ); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609 |
|
485 | + if ( ! $preview || ($preview && defined('DOING_AJAX'))) { |
|
486 | + $style = file_get_contents($this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation), TRUE); |
|
487 | + $CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles($body, $style); |
|
488 | + $body = ltrim($CSS->convert(true), ">\n"); //for some reason the library has a bracket and new line at the beginning. This takes care of that. |
|
489 | + $body = ltrim($body, "<?"); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609 |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | } |
@@ -505,8 +505,8 @@ discard block |
||
505 | 505 | public function get_existing_test_settings() { |
506 | 506 | $settings = parent::get_existing_test_settings(); |
507 | 507 | //override subject if present because we always want it to be fresh. |
508 | - if ( is_array( $settings ) && ! empty( $settings['subject'] ) ) { |
|
509 | - $settings['subject'] = sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ); |
|
508 | + if (is_array($settings) && ! empty($settings['subject'])) { |
|
509 | + $settings['subject'] = sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')); |
|
510 | 510 | } |
511 | 511 | return $settings; |
512 | 512 | } |
@@ -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->_MSGR->set_validator_config( $new_config ); |
|
50 | + $this->_MSGR->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 |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
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'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $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'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -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->_MSGR->set_validator_config( $new_config ); |
|
56 | + $this->_MSGR->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 |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
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'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $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'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -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->_MSGR->set_validator_config( $new_config ); |
|
50 | + $this->_MSGR->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 |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
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'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $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'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -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->_MSGR->set_validator_config( $new_config ); |
|
50 | + $this->_MSGR->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 |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | ); |
50 | 51 | $this->_MSGR->set_validator_config( $new_config ); |
51 | 52 | |
52 | - if ( $this->_context != 'admin' ) |
|
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'); |
|
53 | + if ( $this->_context != 'admin' ) { |
|
54 | + $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'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
56 | 58 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 | |
12 | 12 | /** |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | */ |
25 | 25 | class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator { |
26 | 26 | |
27 | - public function __construct( $fields, $context ) { |
|
27 | + public function __construct($fields, $context) { |
|
28 | 28 | $this->_m_name = 'html'; |
29 | 29 | $this->_mt_name = 'receipt'; |
30 | 30 | |
31 | - parent::__construct( $fields, $context ); |
|
31 | + parent::__construct($fields, $context); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This contains the class for the Html+Invoice Message Template Validator. |
|
4 | - * |
|
5 | - * @since 4.5.0 |
|
6 | - * @package Event Espresso |
|
7 | - * @subpackage messages |
|
8 | - */ |
|
3 | + * This contains the class for the Html+Invoice Message Template Validator. |
|
4 | + * |
|
5 | + * @since 4.5.0 |
|
6 | + * @package Event Espresso |
|
7 | + * @subpackage messages |
|
8 | + */ |
|
9 | 9 | if (!defined('EVENT_ESPRESSO_VERSION') ) |
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | * @param string $shortcode |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - protected function _parser( $shortcode ) { |
|
64 | + protected function _parser($shortcode) { |
|
65 | 65 | |
66 | - if ( ! $this->_data instanceof EE_Datetime ) { |
|
66 | + if ( ! $this->_data instanceof EE_Datetime) { |
|
67 | 67 | return ''; //get out cause we can only parse with the datetime object. |
68 | 68 | } |
69 | 69 | |
70 | - switch ( $shortcode ) { |
|
70 | + switch ($shortcode) { |
|
71 | 71 | |
72 | 72 | case '[DATETIME_START]' : |
73 | 73 | return $this->_data->get_i18n_datetime('DTT_EVT_start'); |
@@ -81,27 +81,27 @@ discard block |
||
81 | 81 | return $this->_data->get_timezone(); |
82 | 82 | break; |
83 | 83 | case '[DATE_START]' : |
84 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) ); |
|
84 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format')); |
|
85 | 85 | break; |
86 | 86 | case '[DATE_END]' : |
87 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) ); |
|
87 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format')); |
|
88 | 88 | break; |
89 | 89 | case '[TIME_START]' : |
90 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) ); |
|
90 | + return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format')); |
|
91 | 91 | break; |
92 | 92 | case '[TIME_END]' : |
93 | - return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) ); |
|
93 | + return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format')); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | |
97 | - if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE ) { |
|
98 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
97 | + if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) { |
|
98 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
99 | 99 | |
100 | - $link_text = empty( $attrs['link_text'] ) ? __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text']; |
|
100 | + $link_text = empty($attrs['link_text']) ? __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text']; |
|
101 | 101 | |
102 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() ); |
|
102 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url()); |
|
103 | 103 | |
104 | - return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>'; |
|
104 | + return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>'; |
|
105 | 105 | |
106 | 106 | } |
107 | 107 |