@@ -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 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @subpackage messages |
20 | 20 | * @author Darren Ethier |
21 | 21 | */ |
22 | -class EE_Html_messenger extends EE_messenger { |
|
22 | +class EE_Html_messenger extends EE_messenger { |
|
23 | 23 | |
24 | 24 | |
25 | 25 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @see abstract declaration in EE_messenger for details. |
63 | 63 | */ |
64 | 64 | protected function _set_admin_pages() { |
65 | - $this->admin_registered_pages = array( 'events_edit' => true ); |
|
65 | + $this->admin_registered_pages = array('events_edit' => true); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -82,29 +82,29 @@ discard block |
||
82 | 82 | protected function _set_validator_config() { |
83 | 83 | $this->_validator_config = array( |
84 | 84 | 'subject' => array( |
85 | - 'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction' ) |
|
85 | + 'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction') |
|
86 | 86 | ), |
87 | 87 | 'content' => array( |
88 | - 'shortcodes' => array( 'organization', 'primary_registration_list', 'primary_registration_details', 'email', 'transaction', 'event_list', 'payment_list', 'venue', 'line_item_list', 'messenger', 'ticket_list') |
|
88 | + 'shortcodes' => array('organization', 'primary_registration_list', 'primary_registration_details', 'email', 'transaction', 'event_list', 'payment_list', 'venue', 'line_item_list', 'messenger', 'ticket_list') |
|
89 | 89 | ), |
90 | 90 | 'event_list' => array( |
91 | - 'shortcodes' => array( 'event', 'ticket_list', 'venue', 'primary_registration_details', 'primary_registration_list', 'event_author' ), |
|
91 | + 'shortcodes' => array('event', 'ticket_list', 'venue', 'primary_registration_details', 'primary_registration_list', 'event_author'), |
|
92 | 92 | 'required' => array('[EVENT_LIST]') |
93 | 93 | ), |
94 | 94 | 'ticket_list' => array( |
95 | - 'shortcodes' => array( 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'line_item_list', 'venue'), |
|
95 | + 'shortcodes' => array('attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'line_item_list', 'venue'), |
|
96 | 96 | 'required' => array('[TICKET_LIST]') |
97 | 97 | ), |
98 | 98 | 'ticket_line_item_no_pms' => array( |
99 | - 'shortcodes' => array( 'line_item', 'ticket' ), |
|
99 | + 'shortcodes' => array('line_item', 'ticket'), |
|
100 | 100 | 'required' => array('[TICKET_LINE_ITEM_LIST]') |
101 | 101 | ), |
102 | 102 | 'ticket_line_item_pms' => array( |
103 | - 'shortcodes' => array( 'line_item', 'ticket', 'line_item_list' ), |
|
103 | + 'shortcodes' => array('line_item', 'ticket', 'line_item_list'), |
|
104 | 104 | 'required' => array('[TICKET_LINE_ITEM_LIST]'), |
105 | 105 | ), |
106 | 106 | 'price_modifier_line_item_list' => array( |
107 | - 'shortcodes' => array( 'line_item' ), |
|
107 | + 'shortcodes' => array('line_item'), |
|
108 | 108 | 'required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]') |
109 | 109 | ), |
110 | 110 | 'datetime_list' => array( |
@@ -132,16 +132,16 @@ discard block |
||
132 | 132 | |
133 | 133 | |
134 | 134 | |
135 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
136 | - if ( $sending_messenger_name = 'pdf' ) { |
|
137 | - add_filter( 'EE_messenger__get_variation__variation', array( $this, 'add_html_css' ), 10, 8 ); |
|
135 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
136 | + if ($sending_messenger_name = 'pdf') { |
|
137 | + add_filter('EE_messenger__get_variation__variation', array($this, 'add_html_css'), 10, 8); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | |
143 | - public function add_html_css( $variation_path, EE_Messages_Template_Pack $template_pack, $messenger_name, $message_type_name, $url, $type, $variation, $skip_filters ) { |
|
144 | - $variation = $template_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters ); |
|
143 | + public function add_html_css($variation_path, EE_Messages_Template_Pack $template_pack, $messenger_name, $message_type_name, $url, $type, $variation, $skip_filters) { |
|
144 | + $variation = $template_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters); |
|
145 | 145 | return $variation; |
146 | 146 | } |
147 | 147 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function enqueue_scripts_styles() { |
156 | 156 | parent::enqueue_scripts_styles(); |
157 | - do_action( 'AHEE__EE_Html_messenger__enqueue_scripts_styles'); |
|
157 | + do_action('AHEE__EE_Html_messenger__enqueue_scripts_styles'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | ), |
215 | 215 | 'ticket_line_item_no_pms' => array( |
216 | 216 | 'input' => 'textarea', |
217 | - 'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __('Ticket Line Item List with no Price Modifiers', 'event_espresso'), |
|
217 | + 'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__('Ticket Line Item List with no Price Modifiers', 'event_espresso'), |
|
218 | 218 | 'type' => 'string', |
219 | 219 | 'required' => FALSE, |
220 | 220 | 'validation' => TRUE, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ), |
226 | 226 | 'ticket_line_item_pms' => array( |
227 | 227 | 'input' => 'textarea', |
228 | - 'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __('Ticket Line Item List with Price Modifiers', 'event_espresso'), |
|
228 | + 'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__('Ticket Line Item List with Price Modifiers', 'event_espresso'), |
|
229 | 229 | 'type' => 'string', |
230 | 230 | 'required' => FALSE, |
231 | 231 | 'validation' => TRUE, |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * |
319 | 319 | */ |
320 | 320 | protected function _set_default_message_types() { |
321 | - $this->_default_message_types = array( 'receipt', 'invoice' ); |
|
321 | + $this->_default_message_types = array('receipt', 'invoice'); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @since 4.5.0 |
330 | 330 | */ |
331 | 331 | protected function _set_valid_message_types() { |
332 | - $this->_valid_message_types = array( 'receipt', 'invoice' ); |
|
332 | + $this->_valid_message_types = array('receipt', 'invoice'); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | |
@@ -344,15 +344,15 @@ discard block |
||
344 | 344 | */ |
345 | 345 | protected function _send_message() { |
346 | 346 | $this->_template_args = array( |
347 | - 'page_title' => html_entity_decode( stripslashes( $this->_subject ), ENT_QUOTES, "UTF-8"), |
|
348 | - 'base_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation ), |
|
349 | - 'print_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation ), |
|
350 | - 'main_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation ), |
|
351 | - 'main_body' => apply_filters( 'FHEE__EE_Html_messenger___send_message__main_body', wpautop(stripslashes_deep( html_entity_decode($this->_content, ENT_QUOTES,"UTF-8" ) )), $this->_content ) |
|
347 | + 'page_title' => html_entity_decode(stripslashes($this->_subject), ENT_QUOTES, "UTF-8"), |
|
348 | + 'base_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation), |
|
349 | + 'print_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation), |
|
350 | + 'main_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation), |
|
351 | + 'main_body' => apply_filters('FHEE__EE_Html_messenger___send_message__main_body', wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))), $this->_content) |
|
352 | 352 | ); |
353 | 353 | |
354 | 354 | $this->_deregister_wp_hooks(); |
355 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) ); |
|
355 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles')); |
|
356 | 356 | echo $this->_get_main_template(); |
357 | 357 | exit(); |
358 | 358 | } |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | $wp_scripts = $wp_styles = array(); |
377 | 377 | |
378 | 378 | //just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load. |
379 | - add_action( 'wp_footer', 'wp_print_footer_scripts' ); |
|
380 | - add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); |
|
379 | + add_action('wp_footer', 'wp_print_footer_scripts'); |
|
380 | + add_action('wp_print_footer_scripts', '_wp_footer_scripts'); |
|
381 | 381 | add_action('wp_head', 'wp_enqueue_scripts'); |
382 | 382 | } |
383 | 383 | |
@@ -391,12 +391,12 @@ discard block |
||
391 | 391 | * |
392 | 392 | * @return string |
393 | 393 | */ |
394 | - protected function _get_main_template( $preview = FALSE ) { |
|
395 | - $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, 'main' ); |
|
394 | + protected function _get_main_template($preview = FALSE) { |
|
395 | + $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, 'main'); |
|
396 | 396 | |
397 | 397 | //require template helper |
398 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
399 | - return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE ); |
|
398 | + EE_Registry::instance()->load_helper('Template'); |
|
399 | + return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 |
@@ -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 file is the wrapper template for the messages-custom-template-switcher rows |
|
4 | - * This template is content for event_switcher_wrapper.template.php |
|
5 | - * @package Event Espresso |
|
6 | - * @subpackage Admin |
|
7 | - * @since 4.3.0 |
|
8 | - */ |
|
3 | + * This file is the wrapper template for the messages-custom-template-switcher rows |
|
4 | + * This template is content for event_switcher_wrapper.template.php |
|
5 | + * @package Event Espresso |
|
6 | + * @subpackage Admin |
|
7 | + * @since 4.3.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Template args in this template |
@@ -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,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This contains the class for the Html+Receipt 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+Receipt 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,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 | * |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * |
6 | 6 | * allows gateways to be used by different systems other than Event Espresso |
7 | 7 | */ |
8 | -interface EEI_Payment extends EEI_Base{ |
|
8 | +interface EEI_Payment extends EEI_Base { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * @return string indicating which the payment is approved, pending, cancelled or failed |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | /** |
153 | 153 | * Interface EEI_Payment_Method |
154 | 154 | */ |
155 | -interface EEI_Payment_Method{ |
|
155 | +interface EEI_Payment_Method { |
|
156 | 156 | |
157 | 157 | } |
158 | 158 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param string $model_name |
172 | 172 | * @return EE_Log |
173 | 173 | */ |
174 | - function gateway_log($message,$id,$model_name); |
|
174 | + function gateway_log($message, $id, $model_name); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -abstract class EE_Offsite_Gateway extends EE_Gateway{ |
|
27 | +abstract class EE_Offsite_Gateway extends EE_Gateway { |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * whether or not the gateway uses an IPN |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param string $cancel_url URL to send the user to after a cancelled payment attempt on teh payment provider's website |
57 | 57 | * @return EE_Payment |
58 | 58 | */ |
59 | - public abstract function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL); |
|
59 | + public abstract function set_redirection_info($payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param EEI_Transaction $transaction |
69 | 69 | * @return EEI_Payment updated |
70 | 70 | */ |
71 | - public abstract function handle_payment_update($update_info,$transaction); |
|
71 | + public abstract function handle_payment_update($update_info, $transaction); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | * @access protected |
95 | 95 | * @param boolean $uses_separate_IPN_request |
96 | 96 | */ |
97 | - protected function set_uses_separate_IPN_request( $uses_separate_IPN_request ) { |
|
98 | - $this->_uses_separate_IPN_request = filter_var( $uses_separate_IPN_request, FILTER_VALIDATE_BOOLEAN ); |
|
97 | + protected function set_uses_separate_IPN_request($uses_separate_IPN_request) { |
|
98 | + $this->_uses_separate_IPN_request = filter_var($uses_separate_IPN_request, FILTER_VALIDATE_BOOLEAN); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -abstract class EE_Onsite_Gateway extends EE_Gateway{ |
|
27 | +abstract class EE_Onsite_Gateway extends EE_Gateway { |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @return EE_Onsite_Gateway |
@@ -53,5 +53,5 @@ discard block |
||
53 | 53 | * } unless a child class specifies these array keys are NOT present |
54 | 54 | * @return EE_Payment updated |
55 | 55 | */ |
56 | - public abstract function do_direct_payment($payment,$billing_info = null); |
|
56 | + public abstract function do_direct_payment($payment, $billing_info = null); |
|
57 | 57 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function instance() { |
32 | 32 | // check if class object is instantiated, and instantiated properly |
33 | - if ( self::$_instance === NULL or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Payment_Method_Manager )) { |
|
33 | + if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Payment_Method_Manager)) { |
|
34 | 34 | self::$_instance = new self(); |
35 | 35 | } |
36 | 36 | EE_Registry::instance()->load_lib('PMT_Base'); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * Resets the instance and returns a new one |
42 | 42 | * @return EE_Payment_Method_Manager |
43 | 43 | */ |
44 | - public static function reset(){ |
|
44 | + public static function reset() { |
|
45 | 45 | self::$_instance = NULL; |
46 | 46 | return self::instance(); |
47 | 47 | } |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | * or just re-use the PMTs we found last time we checked during this request (if |
53 | 53 | * we have not yet checked during this request, then we need to check anyways) |
54 | 54 | */ |
55 | - public function maybe_register_payment_methods( $force_recheck = FALSE ){ |
|
56 | - if( ! $this->_payment_method_types || $force_recheck ){ |
|
55 | + public function maybe_register_payment_methods($force_recheck = FALSE) { |
|
56 | + if ( ! $this->_payment_method_types || $force_recheck) { |
|
57 | 57 | $this->_register_payment_methods(); |
58 | 58 | //if in admin lets ensure caps are set. |
59 | - if ( is_admin() ) { |
|
60 | - add_filter( 'FHEE__EE_Capabilities__init_caps_map__caps', array( $this, 'add_payment_method_caps' ) ); |
|
59 | + if (is_admin()) { |
|
60 | + add_filter('FHEE__EE_Capabilities__init_caps_map__caps', array($this, 'add_payment_method_caps')); |
|
61 | 61 | EE_Registry::instance()->CAP->init_caps(); |
62 | 62 | } |
63 | 63 | } |
@@ -70,19 +70,19 @@ discard block |
||
70 | 70 | */ |
71 | 71 | protected function _register_payment_methods() { |
72 | 72 | // grab list of installed modules |
73 | - $pm_to_register = glob( EE_PAYMENT_METHODS . '*', GLOB_ONLYDIR ); |
|
73 | + $pm_to_register = glob(EE_PAYMENT_METHODS.'*', GLOB_ONLYDIR); |
|
74 | 74 | // filter list of modules to register |
75 | - $pm_to_register = apply_filters( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', $pm_to_register ); |
|
75 | + $pm_to_register = apply_filters('FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', $pm_to_register); |
|
76 | 76 | |
77 | 77 | // loop through folders |
78 | - foreach ( $pm_to_register as $pm_path ) { |
|
79 | - $this->register_payment_method( $pm_path ); |
|
78 | + foreach ($pm_to_register as $pm_path) { |
|
79 | + $this->register_payment_method($pm_path); |
|
80 | 80 | } |
81 | - do_action( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods' ); |
|
81 | + do_action('FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods'); |
|
82 | 82 | // filter list of installed modules |
83 | 83 | //keep them organized alphabetically by the payment method type's name |
84 | - ksort( $this->_payment_method_types ); |
|
85 | - return apply_filters( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__installed_payment_methods', $this->_payment_method_types ); |
|
84 | + ksort($this->_payment_method_types); |
|
85 | + return apply_filters('FHEE__EE_Payment_Method_Manager__register_payment_methods__installed_payment_methods', $this->_payment_method_types); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
@@ -94,35 +94,35 @@ discard block |
||
94 | 94 | * @param string $payment_method_path - full path up to and including payment method folder |
95 | 95 | * @return boolean |
96 | 96 | */ |
97 | - public function register_payment_method( $payment_method_path = '' ) { |
|
98 | - do_action( 'AHEE__EE_Payment_Method_Manager__register_payment_method__begin',$payment_method_path ); |
|
97 | + public function register_payment_method($payment_method_path = '') { |
|
98 | + do_action('AHEE__EE_Payment_Method_Manager__register_payment_method__begin', $payment_method_path); |
|
99 | 99 | $module_ext = '.pm.php'; |
100 | 100 | // make all separators match |
101 | - $payment_method_path = rtrim( str_replace( '/\\', DS, $payment_method_path ), DS ); |
|
101 | + $payment_method_path = rtrim(str_replace('/\\', DS, $payment_method_path), DS); |
|
102 | 102 | // grab and sanitize module name |
103 | - $module_dir = basename( $payment_method_path ); |
|
103 | + $module_dir = basename($payment_method_path); |
|
104 | 104 | // create classname from module directory name |
105 | - $module = str_replace( ' ', '_', str_replace( '_', ' ', $module_dir )); |
|
105 | + $module = str_replace(' ', '_', str_replace('_', ' ', $module_dir)); |
|
106 | 106 | // add class prefix |
107 | - $module_class = 'EE_PMT_' . $module; |
|
107 | + $module_class = 'EE_PMT_'.$module; |
|
108 | 108 | // does the module exist ? |
109 | - if ( ! is_readable( $payment_method_path . DS . $module_class . $module_ext )) { |
|
110 | - $msg = sprintf( __( 'The requested %s payment method file could not be found or is not readable due to file permissions.', 'event_espresso' ), $module ); |
|
111 | - EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
109 | + if ( ! is_readable($payment_method_path.DS.$module_class.$module_ext)) { |
|
110 | + $msg = sprintf(__('The requested %s payment method file could not be found or is not readable due to file permissions.', 'event_espresso'), $module); |
|
111 | + EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__); |
|
112 | 112 | return FALSE; |
113 | 113 | } |
114 | - if ( WP_DEBUG === TRUE ) { EEH_Debug_Tools::instance()->start_timer(); } |
|
114 | + if (WP_DEBUG === TRUE) { EEH_Debug_Tools::instance()->start_timer(); } |
|
115 | 115 | // load the module class file |
116 | - require_once( $payment_method_path . DS . $module_class . $module_ext ); |
|
117 | - if ( WP_DEBUG === TRUE ) { EEH_Debug_Tools::instance()->stop_timer("Requiring payment method $module_class"); } |
|
116 | + require_once($payment_method_path.DS.$module_class.$module_ext); |
|
117 | + if (WP_DEBUG === TRUE) { EEH_Debug_Tools::instance()->stop_timer("Requiring payment method $module_class"); } |
|
118 | 118 | // verify that class exists |
119 | - if ( ! class_exists( $module_class )) { |
|
120 | - $msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class ); |
|
121 | - EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
119 | + if ( ! class_exists($module_class)) { |
|
120 | + $msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class); |
|
121 | + EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__); |
|
122 | 122 | return FALSE; |
123 | 123 | } |
124 | 124 | // add to array of registered modules |
125 | - $this->_payment_method_types[ $module ] = $payment_method_path . DS . $module_class . $module_ext; |
|
125 | + $this->_payment_method_types[$module] = $payment_method_path.DS.$module_class.$module_ext; |
|
126 | 126 | return TRUE; |
127 | 127 | } |
128 | 128 | /** |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | * @param boolean $force_recheck whether to force re-checking for new payment method types |
132 | 132 | * @return boolean |
133 | 133 | */ |
134 | - public function payment_method_type_exists($payment_method_name, $force_recheck = FALSE){ |
|
135 | - if ( ! is_array( $this->_payment_method_types ) || ! isset( $this->_payment_method_types[$payment_method_name] ) |
|
136 | - || $force_recheck ) { |
|
134 | + public function payment_method_type_exists($payment_method_name, $force_recheck = FALSE) { |
|
135 | + if ( ! is_array($this->_payment_method_types) || ! isset($this->_payment_method_types[$payment_method_name]) |
|
136 | + || $force_recheck) { |
|
137 | 137 | $this->maybe_register_payment_methods($force_recheck); |
138 | 138 | } |
139 | - if(isset($this->_payment_method_types[$payment_method_name])){ |
|
139 | + if (isset($this->_payment_method_types[$payment_method_name])) { |
|
140 | 140 | require_once($this->_payment_method_types[$payment_method_name]); |
141 | 141 | return true; |
142 | - }else{ |
|
142 | + } else { |
|
143 | 143 | return false; |
144 | 144 | } |
145 | 145 | } |
@@ -150,16 +150,16 @@ discard block |
||
150 | 150 | * @param boolean $force_recheck whether to force re-checking for new payment method types |
151 | 151 | * @return array |
152 | 152 | */ |
153 | - public function payment_method_type_names($with_prefixes = FALSE, $force_recheck = FALSE ){ |
|
153 | + public function payment_method_type_names($with_prefixes = FALSE, $force_recheck = FALSE) { |
|
154 | 154 | $this->maybe_register_payment_methods($force_recheck); |
155 | - if($with_prefixes){ |
|
155 | + if ($with_prefixes) { |
|
156 | 156 | $classnames = array_keys($this->_payment_method_types); |
157 | 157 | $payment_methods = array(); |
158 | - foreach($classnames as $classname){ |
|
158 | + foreach ($classnames as $classname) { |
|
159 | 159 | $payment_methods[] = $this->payment_method_class_from_type($classname); |
160 | 160 | } |
161 | 161 | return $payment_methods; |
162 | - }else{ |
|
162 | + } else { |
|
163 | 163 | return array_keys($this->_payment_method_types); |
164 | 164 | } |
165 | 165 | } |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | * @param boolean $force_recheck whether to force re-checking for new payment method types |
170 | 170 | * @return EE_PMT_Base[] |
171 | 171 | */ |
172 | - public function payment_method_types( $force_recheck = FALSE ){ |
|
172 | + public function payment_method_types($force_recheck = FALSE) { |
|
173 | 173 | $this->maybe_register_payment_methods($force_recheck); |
174 | 174 | $pmt_objs = array(); |
175 | - foreach($this->payment_method_type_names(true) as $classname){ |
|
175 | + foreach ($this->payment_method_type_names(true) as $classname) { |
|
176 | 176 | $pmt_objs[] = new $classname; |
177 | 177 | } |
178 | 178 | return $pmt_objs; |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | * @param string $classname |
185 | 185 | * @return string |
186 | 186 | */ |
187 | - public function payment_method_type_sans_class_prefix($classname){ |
|
188 | - $pmt_name = str_replace("EE_PMT_","",$classname); |
|
187 | + public function payment_method_type_sans_class_prefix($classname) { |
|
188 | + $pmt_name = str_replace("EE_PMT_", "", $classname); |
|
189 | 189 | return $pmt_name; |
190 | 190 | } |
191 | 191 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @param string $type |
195 | 195 | * @return string |
196 | 196 | */ |
197 | - public function payment_method_class_from_type($type){ |
|
197 | + public function payment_method_class_from_type($type) { |
|
198 | 198 | $this->maybe_register_payment_methods(); |
199 | 199 | return "EE_PMT_".$type; |
200 | 200 | } |
@@ -205,52 +205,52 @@ discard block |
||
205 | 205 | * @param string $payment_method_type the PMT_type; for EE_PMT_Invoice this would be 'Invoice' |
206 | 206 | * @return EE_Payment_Method |
207 | 207 | */ |
208 | - public function activate_a_payment_method_of_type( $payment_method_type ){ |
|
208 | + public function activate_a_payment_method_of_type($payment_method_type) { |
|
209 | 209 | $payment_method = EEM_Payment_Method::instance()->get_one_of_type($payment_method_type); |
210 | - if( ! $payment_method){ |
|
210 | + if ( ! $payment_method) { |
|
211 | 211 | global $current_user; |
212 | 212 | $pm_type_class = $this->payment_method_class_from_type($payment_method_type); |
213 | - if(class_exists($pm_type_class)){ |
|
213 | + if (class_exists($pm_type_class)) { |
|
214 | 214 | /** @var $pm_type_obj EE_PMT_Base */ |
215 | 215 | $pm_type_obj = new $pm_type_class; |
216 | 216 | $payment_method = EEM_Payment_Method::instance()->get_one_by_slug($pm_type_obj->system_name()); |
217 | - if( ! $payment_method){ |
|
217 | + if ( ! $payment_method) { |
|
218 | 218 | $payment_method = EE_Payment_Method::new_instance(array( |
219 | 219 | 'PMD_type'=>$pm_type_obj->system_name(), |
220 | 220 | 'PMD_name'=>$pm_type_obj->pretty_name(), |
221 | 221 | 'PMD_admin_name'=>$pm_type_obj->pretty_name(), |
222 | - 'PMD_slug'=>$pm_type_obj->system_name(),//automatically converted to slug |
|
222 | + 'PMD_slug'=>$pm_type_obj->system_name(), //automatically converted to slug |
|
223 | 223 | 'PMD_wp_user'=>$current_user->ID, |
224 | - 'PMD_order' => EEM_Payment_Method::instance()->count( array( array( 'PMD_type' => array( '!=', 'Admin_Only' )))) * 10, |
|
224 | + 'PMD_order' => EEM_Payment_Method::instance()->count(array(array('PMD_type' => array('!=', 'Admin_Only')))) * 10, |
|
225 | 225 | )); |
226 | 226 | } |
227 | 227 | $payment_method->set_active(); |
228 | - $payment_method->set_description( $pm_type_obj->default_description() ); |
|
228 | + $payment_method->set_description($pm_type_obj->default_description()); |
|
229 | 229 | //handles the goofy case where someone activates the invoice gateway which is also |
230 | 230 | $payment_method->set_type($pm_type_obj->system_name()); |
231 | - if( ! $payment_method->button_url() ){ |
|
232 | - $payment_method->set_button_url( $pm_type_obj->default_button_url() ); |
|
231 | + if ( ! $payment_method->button_url()) { |
|
232 | + $payment_method->set_button_url($pm_type_obj->default_button_url()); |
|
233 | 233 | } |
234 | 234 | $payment_method->save(); |
235 | - foreach($payment_method->get_all_usable_currencies() as $currency_obj){ |
|
235 | + foreach ($payment_method->get_all_usable_currencies() as $currency_obj) { |
|
236 | 236 | $payment_method->_add_relation_to($currency_obj, 'Currency'); |
237 | 237 | } |
238 | 238 | //now add setup its default extra meta properties |
239 | 239 | $extra_metas = $payment_method->type_obj()->settings_form()->extra_meta_inputs(); |
240 | - foreach( $extra_metas as $meta_name => $input ){ |
|
241 | - $payment_method->update_extra_meta($meta_name, $input->raw_value() ); |
|
240 | + foreach ($extra_metas as $meta_name => $input) { |
|
241 | + $payment_method->update_extra_meta($meta_name, $input->raw_value()); |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
245 | - }else{ |
|
245 | + } else { |
|
246 | 246 | $payment_method->set_active(); |
247 | 247 | $payment_method->save(); |
248 | 248 | } |
249 | - if( $payment_method->type() == 'Invoice' ){ |
|
250 | - $messages = EE_Registry::instance()->load_lib( 'messages' ); |
|
251 | - $messages->ensure_message_type_is_active( 'invoice', 'html' ); |
|
252 | - $messages->ensure_messenger_is_active( 'pdf' ); |
|
253 | - EE_Error::add_attention( sprintf( __( 'Note, when the invoice payment method is activated, the invoice message type, html messenger, and pdf messenger are activated as well for the %1$smessages system%2$s.', 'event_espresso' ), '<a href="' . admin_url( 'admin.php?page=espresso_messages') . '">', '</a>' ) ); |
|
249 | + if ($payment_method->type() == 'Invoice') { |
|
250 | + $messages = EE_Registry::instance()->load_lib('messages'); |
|
251 | + $messages->ensure_message_type_is_active('invoice', 'html'); |
|
252 | + $messages->ensure_messenger_is_active('pdf'); |
|
253 | + EE_Error::add_attention(sprintf(__('Note, when the invoice payment method is activated, the invoice message type, html messenger, and pdf messenger are activated as well for the %1$smessages system%2$s.', 'event_espresso'), '<a href="'.admin_url('admin.php?page=espresso_messages').'">', '</a>')); |
|
254 | 254 | } |
255 | 255 | return $payment_method; |
256 | 256 | } |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | * |
266 | 266 | * @return int count of rows updated. |
267 | 267 | */ |
268 | - public function deactivate_payment_method( $payment_method_slug ) { |
|
269 | - $count_updated = EEM_Payment_Method::instance()->update(array('PMD_scope'=>array()),array(array('PMD_slug'=>$payment_method_slug))); |
|
268 | + public function deactivate_payment_method($payment_method_slug) { |
|
269 | + $count_updated = EEM_Payment_Method::instance()->update(array('PMD_scope'=>array()), array(array('PMD_slug'=>$payment_method_slug))); |
|
270 | 270 | return $count_updated; |
271 | 271 | } |
272 | 272 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * |
280 | 280 | * @param array $caps capabilities being filtered |
281 | 281 | */ |
282 | - public function add_payment_method_caps( $caps ) { |
|
282 | + public function add_payment_method_caps($caps) { |
|
283 | 283 | /* add dynamic caps from payment methods |
284 | 284 | * at the time of writing, october 20 2014, these are the caps added: |
285 | 285 | * ee_payment_method_admin_only |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * their related capability automatically added too, so long as they are |
295 | 295 | * registered properly using EE_Register_Payment_Method::register() |
296 | 296 | */ |
297 | - foreach( $this->payment_method_types() as $payment_method_type_obj ){ |
|
297 | + foreach ($this->payment_method_types() as $payment_method_type_obj) { |
|
298 | 298 | $caps['administrator'][] = $payment_method_type_obj->cap_name(); |
299 | 299 | } |
300 | 300 | return $caps; |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * |
4 | 6 | * Class EE_Payment_Method_Manager |
@@ -139,7 +141,7 @@ discard block |
||
139 | 141 | if(isset($this->_payment_method_types[$payment_method_name])){ |
140 | 142 | require_once($this->_payment_method_types[$payment_method_name]); |
141 | 143 | return true; |
142 | - }else{ |
|
144 | + } else{ |
|
143 | 145 | return false; |
144 | 146 | } |
145 | 147 | } |
@@ -159,7 +161,7 @@ discard block |
||
159 | 161 | $payment_methods[] = $this->payment_method_class_from_type($classname); |
160 | 162 | } |
161 | 163 | return $payment_methods; |
162 | - }else{ |
|
164 | + } else{ |
|
163 | 165 | return array_keys($this->_payment_method_types); |
164 | 166 | } |
165 | 167 | } |
@@ -242,7 +244,7 @@ discard block |
||
242 | 244 | } |
243 | 245 | } |
244 | 246 | |
245 | - }else{ |
|
247 | + } else{ |
|
246 | 248 | $payment_method->set_active(); |
247 | 249 | $payment_method->save(); |
248 | 250 | } |