@@ -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_Cancelled_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 = 'cancelled_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,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_Cancelled_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 = 'cancelled_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,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_Cancelled_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 = 'cancelled_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,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_Reminder_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_reminder'; |
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,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_Cancelled_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 = 'cancelled_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,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_Reminder_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_reminder'; |
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,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 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Identifier properties for the recipient |
23 | 23 | */ |
24 | - public $user_id; //if available we'll use this to set the fname and lname (admin) |
|
24 | + public $user_id; //if available we'll use this to set the fname and lname (admin) |
|
25 | 25 | public $fname; //this will always be the admin fname (set later via incoming user_id) |
26 | 26 | public $lname; //this will always be the admin lname (set later via incoming user_id) |
27 | 27 | public $primary_registration_id; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @access public |
151 | 151 | * @param array $addressee_data We're expecting an incoming array of data that will be used to fill the properties for the object. |
152 | 152 | */ |
153 | - public function __construct( $addressee_data ) { |
|
153 | + public function __construct($addressee_data) { |
|
154 | 154 | $this->_data = $addressee_data; |
155 | 155 | $this->_set_properties(); |
156 | 156 | } |
@@ -166,15 +166,15 @@ discard block |
||
166 | 166 | */ |
167 | 167 | protected function _set_properties() { |
168 | 168 | |
169 | - foreach ( $this->_data as $prop => $value ) { |
|
170 | - if( property_exists( $this, $prop ) ) |
|
169 | + foreach ($this->_data as $prop => $value) { |
|
170 | + if (property_exists($this, $prop)) |
|
171 | 171 | $this->$prop = $value; |
172 | 172 | } |
173 | 173 | |
174 | 174 | //if user_id present we'll use this to set the fname and lname and admin_email. |
175 | - if ( !empty( $this->user_id ) ) { |
|
175 | + if ( ! empty($this->user_id)) { |
|
176 | 176 | $this->user_id = (int) $this->user_id; |
177 | - $user = get_userdata( $this->user_id ); |
|
177 | + $user = get_userdata($this->user_id); |
|
178 | 178 | $this->fname = $user->user_firstname; |
179 | 179 | $this->lname = $user->user_lastname; |
180 | 180 | $this->admin_email = $user->user_email; |
@@ -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 | * EE_Messages_Addressee |
@@ -167,8 +168,9 @@ discard block |
||
167 | 168 | protected function _set_properties() { |
168 | 169 | |
169 | 170 | foreach ( $this->_data as $prop => $value ) { |
170 | - if( property_exists( $this, $prop ) ) |
|
171 | - $this->{$prop} = $value; |
|
171 | + if( property_exists( $this, $prop ) ) { |
|
172 | + $this->{$prop} = $value; |
|
173 | + } |
|
172 | 174 | } |
173 | 175 | |
174 | 176 | //if user_id present we'll use this to set the fname and lname and admin_email. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | protected function _set_admin_pages() { |
58 | - $this->admin_registered_pages = array( 'events_edit' => TRUE ); |
|
58 | + $this->admin_registered_pages = array('events_edit' => TRUE); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -68,17 +68,17 @@ discard block |
||
68 | 68 | |
69 | 69 | protected function _set_with_messengers() { |
70 | 70 | $this->_with_messengers = array( |
71 | - 'html' => array( 'pdf' ) |
|
71 | + 'html' => array('pdf') |
|
72 | 72 | ); |
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | - protected function _get_data_for_context( $context, EE_Registration $registration, $id ) { |
|
77 | + protected function _get_data_for_context($context, EE_Registration $registration, $id) { |
|
78 | 78 | //receipt message type data handler is 'Gateways' and it expects a transaction object. |
79 | 79 | $transaction = $registration->transaction(); |
80 | - if ( $transaction instanceof EE_Transaction ) { |
|
81 | - return array( $transaction ); |
|
80 | + if ($transaction instanceof EE_Transaction) { |
|
81 | + return array($transaction); |
|
82 | 82 | } |
83 | 83 | return array(); |
84 | 84 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return void |
118 | 118 | */ |
119 | 119 | protected function _set_valid_shortcodes() { |
120 | - $this->_valid_shortcodes[ 'purchaser' ] = array( |
|
120 | + $this->_valid_shortcodes['purchaser'] = array( |
|
121 | 121 | 'attendee_list', |
122 | 122 | 'attendee', |
123 | 123 | 'datetime_list', |
@@ -41,22 +41,22 @@ discard block |
||
41 | 41 | $this->label = __('Messenger Shortcodes', 'event_espresso'); |
42 | 42 | $this->description = __('All shortcodes that are messenger specific.', 'event_espresso'); |
43 | 43 | /** @type EE_Message_Resource_Manager $message_resource_manager */ |
44 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
44 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
45 | 45 | //add messages about what happens when the messenger is active. |
46 | 46 | $this->_active_messengers = $message_resource_manager->active_messengers(); |
47 | 47 | |
48 | - $this->_shortcodes['[DISPLAY_HTML_URL]'] =__('This will return a link to view the template in a browser if the html messenger is active.', 'event_espresso'); |
|
49 | - $this->_shortcodes['[DISPLAY_PDF_URL]'] = __('This will return a link to generate a pdf for the template if the pdf messenger is active.', 'event_espresso' ); |
|
48 | + $this->_shortcodes['[DISPLAY_HTML_URL]'] = __('This will return a link to view the template in a browser if the html messenger is active.', 'event_espresso'); |
|
49 | + $this->_shortcodes['[DISPLAY_PDF_URL]'] = __('This will return a link to generate a pdf for the template if the pdf messenger is active.', 'event_espresso'); |
|
50 | 50 | $this->_shortcodes['[DISPLAY_PDF_BUTTON]'] = __('This will return html for a download pdf button trigger if the pdf messenger is active.', 'event_espresso'); |
51 | 51 | |
52 | 52 | //show error message about buttons/urls not working as expected if messenger deactivated. |
53 | - if ( is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'update_message_template' ) { |
|
54 | - if ( ! isset( $this->_active_messengers['pdf'] ) ) { |
|
55 | - EE_Error::add_attention( __('Be aware that the pdf messenger is inactive. This means that any pdf related shortcodes will parse to an empty string.', 'event_espresso' ) ); |
|
53 | + if (is_admin() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'update_message_template') { |
|
54 | + if ( ! isset($this->_active_messengers['pdf'])) { |
|
55 | + EE_Error::add_attention(__('Be aware that the pdf messenger is inactive. This means that any pdf related shortcodes will parse to an empty string.', 'event_espresso')); |
|
56 | 56 | } |
57 | 57 | |
58 | - if ( !isset( $this->_active_messengers['html'] ) ) { |
|
59 | - EE_Error::add_attention( __('Be aware that the html messenger is inactive. This means that any html related shortcodes will parse to an empty string.', 'event_espresso' ) ); |
|
58 | + if ( ! isset($this->_active_messengers['html'])) { |
|
59 | + EE_Error::add_attention(__('Be aware that the html messenger is inactive. This means that any html related shortcodes will parse to an empty string.', 'event_espresso')); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -64,24 +64,24 @@ discard block |
||
64 | 64 | |
65 | 65 | |
66 | 66 | |
67 | - protected function _parser( $shortcode ) { |
|
67 | + protected function _parser($shortcode) { |
|
68 | 68 | //make sure we end up with a copy of the EE_Messages_Addressee object |
69 | 69 | $recipient = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL; |
70 | - $recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient; |
|
71 | - $recipient = ! $recipient instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient; |
|
70 | + $recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset($this->_data['data']) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient; |
|
71 | + $recipient = ! $recipient instanceof EE_Messages_Addressee && ! empty($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient; |
|
72 | 72 | |
73 | - if ( ! $recipient instanceof EE_Messages_Addressee ) |
|
73 | + if ( ! $recipient instanceof EE_Messages_Addressee) |
|
74 | 74 | return ''; |
75 | 75 | |
76 | - switch ( $shortcode ) { |
|
76 | + switch ($shortcode) { |
|
77 | 77 | case '[DISPLAY_HTML_URL]' : |
78 | - return isset( $this->_active_messengers['html'] ) ? $this->_get_url( $recipient, 'html' ) : ''; |
|
78 | + return isset($this->_active_messengers['html']) ? $this->_get_url($recipient, 'html') : ''; |
|
79 | 79 | break; |
80 | 80 | case '[DISPLAY_PDF_URL]' : |
81 | - return isset( $this->_active_messengers['pdf'] ) ? $this->_get_url( $recipient, 'pdf' ) : ''; |
|
81 | + return isset($this->_active_messengers['pdf']) ? $this->_get_url($recipient, 'pdf') : ''; |
|
82 | 82 | break; |
83 | 83 | case '[DISPLAY_PDF_BUTTON]' : |
84 | - return isset( $this->_active_messengers['pdf'] ) ? $this->_get_button( $recipient, 'pdf' ) : ''; |
|
84 | + return isset($this->_active_messengers['pdf']) ? $this->_get_button($recipient, 'pdf') : ''; |
|
85 | 85 | break; |
86 | 86 | } |
87 | 87 | return ''; |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return string Generated html |
101 | 101 | */ |
102 | - private function _get_button( EE_Messages_Addressee $recipient, $sending_messenger ) { |
|
103 | - $download_text = $sending_messenger == 'pdf' ? __('Download PDF', 'event_espresso') : __('Show HTML', 'event_espresso' ); |
|
102 | + private function _get_button(EE_Messages_Addressee $recipient, $sending_messenger) { |
|
103 | + $download_text = $sending_messenger == 'pdf' ? __('Download PDF', 'event_espresso') : __('Show HTML', 'event_espresso'); |
|
104 | 104 | $content = ' |
105 | -<form method="post" action="' . $this->_get_url( $recipient, $sending_messenger ) . '" > |
|
106 | - <input class="print_button" type="submit" value="' . $download_text . '" /> |
|
105 | +<form method="post" action="' . $this->_get_url($recipient, $sending_messenger).'" > |
|
106 | + <input class="print_button" type="submit" value="' . $download_text.'" /> |
|
107 | 107 | </form> |
108 | 108 | '; |
109 | 109 | return $content; |
@@ -122,18 +122,18 @@ discard block |
||
122 | 122 | * @return string The generated url for displaying the link. |
123 | 123 | * @throws EE_Error |
124 | 124 | */ |
125 | - private function _get_url( EE_Messages_Addressee $recipient, $sending_messenger ) { |
|
125 | + private function _get_url(EE_Messages_Addressee $recipient, $sending_messenger) { |
|
126 | 126 | |
127 | 127 | $reg = $recipient->reg_obj; |
128 | 128 | $reg = ! $reg instanceof EE_Registration ? $recipient->primary_reg_obj : $reg; |
129 | 129 | |
130 | 130 | |
131 | - if ( $this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message ) { |
|
132 | - EE_Registry::instance()->load_helper( 'MSG_Template' ); |
|
131 | + if ($this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message) { |
|
132 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
133 | 133 | try { |
134 | - return EEH_MSG_Template::get_url_trigger( $this->_message_type, $this->_message, $reg, $sending_messenger ); |
|
135 | - } catch( EE_Error $e ) { |
|
136 | - if ( WP_DEBUG ) { |
|
134 | + return EEH_MSG_Template::get_url_trigger($this->_message_type, $this->_message, $reg, $sending_messenger); |
|
135 | + } catch (EE_Error $e) { |
|
136 | + if (WP_DEBUG) { |
|
137 | 137 | $e->get_error(); |
138 | 138 | } |
139 | 139 | } |