@@ -15,37 +15,37 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'payment_refund'; |
|
22 | - |
|
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
25 | - |
|
26 | - /** |
|
27 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - |
|
33 | - // modify just event_list |
|
34 | - $new_config['event_list'] = array( |
|
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | - ); |
|
37 | - $new_config['ticket_list'] = array( |
|
38 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | - ); |
|
40 | - $new_config['content'] = array( |
|
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | - ); |
|
43 | - $this->_messenger->set_validator_config($new_config); |
|
44 | - |
|
45 | - if ($this->_context != 'admin') { |
|
46 | - $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'); |
|
47 | - } |
|
48 | - |
|
49 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | - } |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'payment_refund'; |
|
22 | + |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | + |
|
26 | + /** |
|
27 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + |
|
33 | + // modify just event_list |
|
34 | + $new_config['event_list'] = array( |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | + ); |
|
37 | + $new_config['ticket_list'] = array( |
|
38 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | + ); |
|
40 | + $new_config['content'] = array( |
|
41 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | + ); |
|
43 | + $this->_messenger->set_validator_config($new_config); |
|
44 | + |
|
45 | + if ($this->_context != 'admin') { |
|
46 | + $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'); |
|
47 | + } |
|
48 | + |
|
49 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | + } |
|
51 | 51 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $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'); |
|
46 | + $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'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -16,31 +16,31 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - public function __construct($fields, $context) |
|
20 | - { |
|
21 | - $this->_m_name = 'email'; |
|
22 | - $this->_mt_name = 'registration_summary'; |
|
19 | + public function __construct($fields, $context) |
|
20 | + { |
|
21 | + $this->_m_name = 'email'; |
|
22 | + $this->_mt_name = 'registration_summary'; |
|
23 | 23 | |
24 | - parent::__construct($fields, $context); |
|
25 | - } |
|
24 | + parent::__construct($fields, $context); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * custom validator (restricting what was originally set by the messenger) |
|
29 | - */ |
|
30 | - protected function _modify_validator() |
|
31 | - { |
|
32 | - $new_config = $this->_messenger->get_validator_config(); |
|
33 | - // modify just event_list |
|
34 | - $new_config['event_list'] = array( |
|
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
36 | - 'required' => array('[EVENT_LIST]') |
|
37 | - ); |
|
38 | - $this->_messenger->set_validator_config($new_config); |
|
27 | + /** |
|
28 | + * custom validator (restricting what was originally set by the messenger) |
|
29 | + */ |
|
30 | + protected function _modify_validator() |
|
31 | + { |
|
32 | + $new_config = $this->_messenger->get_validator_config(); |
|
33 | + // modify just event_list |
|
34 | + $new_config['event_list'] = array( |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
36 | + 'required' => array('[EVENT_LIST]') |
|
37 | + ); |
|
38 | + $this->_messenger->set_validator_config($new_config); |
|
39 | 39 | |
40 | - if ($this->_context != 'admin') { |
|
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | - } |
|
40 | + if ($this->_context != 'admin') { |
|
41 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | + } |
|
43 | 43 | |
44 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
45 | - } |
|
44 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
45 | + } |
|
46 | 46 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'registration'; |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'registration'; |
|
22 | 22 | |
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * custom validator (restricting what was originally set by the messenger) |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - // modify just event_list |
|
33 | - $new_config['event_list'] = array( |
|
34 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | - 'required' => array('[EVENT_LIST]') |
|
36 | - ); |
|
37 | - $this->_messenger->set_validator_config($new_config); |
|
26 | + /** |
|
27 | + * custom validator (restricting what was originally set by the messenger) |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + // modify just event_list |
|
33 | + $new_config['event_list'] = array( |
|
34 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | + 'required' => array('[EVENT_LIST]') |
|
36 | + ); |
|
37 | + $this->_messenger->set_validator_config($new_config); |
|
38 | 38 | |
39 | - if ($this->_context != 'admin') { |
|
40 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | - } |
|
39 | + if ($this->_context != 'admin') { |
|
40 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + } |
|
42 | 42 | |
43 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | - } |
|
43 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | + } |
|
45 | 45 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,30 +15,30 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'not_approved_registration'; |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'not_approved_registration'; |
|
22 | 22 | |
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * custom validator (restricting what was originally set by the messenger) |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - $new_config['event_list'] = array( |
|
33 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
34 | - 'required' => array('[EVENT_LIST]') |
|
35 | - ); |
|
36 | - $this->_messenger->set_validator_config($new_config); |
|
26 | + /** |
|
27 | + * custom validator (restricting what was originally set by the messenger) |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + $new_config['event_list'] = array( |
|
33 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
34 | + 'required' => array('[EVENT_LIST]') |
|
35 | + ); |
|
36 | + $this->_messenger->set_validator_config($new_config); |
|
37 | 37 | |
38 | - if ($this->_context != 'admin') { |
|
39 | - $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'); |
|
40 | - } |
|
38 | + if ($this->_context != 'admin') { |
|
39 | + $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'); |
|
40 | + } |
|
41 | 41 | |
42 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
43 | - } |
|
42 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
43 | + } |
|
44 | 44 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'pending_approval'; |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'pending_approval'; |
|
22 | 22 | |
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * custom validator (restricting what was originally set by the messenger) |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - // modify just event_list |
|
33 | - $new_config['event_list'] = array( |
|
34 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | - 'required' => array('[EVENT_LIST]') |
|
36 | - ); |
|
37 | - $this->_messenger->set_validator_config($new_config); |
|
26 | + /** |
|
27 | + * custom validator (restricting what was originally set by the messenger) |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + // modify just event_list |
|
33 | + $new_config['event_list'] = array( |
|
34 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
35 | + 'required' => array('[EVENT_LIST]') |
|
36 | + ); |
|
37 | + $this->_messenger->set_validator_config($new_config); |
|
38 | 38 | |
39 | - if ($this->_context != 'admin') { |
|
40 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | - } |
|
39 | + if ($this->_context != 'admin') { |
|
40 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + } |
|
42 | 42 | |
43 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | - } |
|
43 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
44 | + } |
|
45 | 45 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -15,37 +15,37 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - public function __construct($fields, $context) |
|
19 | - { |
|
20 | - $this->_m_name = 'email'; |
|
21 | - $this->_mt_name = 'payment'; |
|
22 | - |
|
23 | - parent::__construct($fields, $context); |
|
24 | - } |
|
25 | - |
|
26 | - /** |
|
27 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | - */ |
|
29 | - protected function _modify_validator() |
|
30 | - { |
|
31 | - $new_config = $this->_messenger->get_validator_config(); |
|
32 | - |
|
33 | - // modify just event_list |
|
34 | - $new_config['event_list'] = array( |
|
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | - ); |
|
37 | - $new_config['ticket_list'] = array( |
|
38 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | - ); |
|
40 | - $new_config['content'] = array( |
|
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | - ); |
|
43 | - $this->_messenger->set_validator_config($new_config); |
|
44 | - |
|
45 | - if ($this->_context != 'admin') { |
|
46 | - $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'); |
|
47 | - } |
|
48 | - |
|
49 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | - } |
|
18 | + public function __construct($fields, $context) |
|
19 | + { |
|
20 | + $this->_m_name = 'email'; |
|
21 | + $this->_mt_name = 'payment'; |
|
22 | + |
|
23 | + parent::__construct($fields, $context); |
|
24 | + } |
|
25 | + |
|
26 | + /** |
|
27 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
28 | + */ |
|
29 | + protected function _modify_validator() |
|
30 | + { |
|
31 | + $new_config = $this->_messenger->get_validator_config(); |
|
32 | + |
|
33 | + // modify just event_list |
|
34 | + $new_config['event_list'] = array( |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | + ); |
|
37 | + $new_config['ticket_list'] = array( |
|
38 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
39 | + ); |
|
40 | + $new_config['content'] = array( |
|
41 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | + ); |
|
43 | + $this->_messenger->set_validator_config($new_config); |
|
44 | + |
|
45 | + if ($this->_context != 'admin') { |
|
46 | + $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'); |
|
47 | + } |
|
48 | + |
|
49 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
50 | + } |
|
51 | 51 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $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'); |
|
46 | + $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'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -16,21 +16,21 @@ |
||
16 | 16 | class EE_Messages_Html_Invoice_Validator extends EE_Messages_Validator |
17 | 17 | { |
18 | 18 | |
19 | - public function __construct($fields, $context) |
|
20 | - { |
|
21 | - $this->_m_name = 'html'; |
|
22 | - $this->_mt_name = 'invoice'; |
|
19 | + public function __construct($fields, $context) |
|
20 | + { |
|
21 | + $this->_m_name = 'html'; |
|
22 | + $this->_mt_name = 'invoice'; |
|
23 | 23 | |
24 | - parent::__construct($fields, $context); |
|
25 | - } |
|
24 | + parent::__construct($fields, $context); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * custom validator (restricting what was originally set by the messenger). |
|
29 | - * Note nothing is currently done for this messenger and message type. |
|
30 | - */ |
|
31 | - protected function _modify_validator() |
|
32 | - { |
|
33 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | - return; |
|
35 | - } |
|
27 | + /** |
|
28 | + * custom validator (restricting what was originally set by the messenger). |
|
29 | + * Note nothing is currently done for this messenger and message type. |
|
30 | + */ |
|
31 | + protected function _modify_validator() |
|
32 | + { |
|
33 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | + return; |
|
35 | + } |
|
36 | 36 | } |
@@ -16,21 +16,21 @@ |
||
16 | 16 | class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator |
17 | 17 | { |
18 | 18 | |
19 | - public function __construct($fields, $context) |
|
20 | - { |
|
21 | - $this->_m_name = 'html'; |
|
22 | - $this->_mt_name = 'receipt'; |
|
19 | + public function __construct($fields, $context) |
|
20 | + { |
|
21 | + $this->_m_name = 'html'; |
|
22 | + $this->_mt_name = 'receipt'; |
|
23 | 23 | |
24 | - parent::__construct($fields, $context); |
|
25 | - } |
|
24 | + parent::__construct($fields, $context); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * custom validator (restricting what was originally set by the messenger). |
|
29 | - * Note nothing is currently done for this messenger and message type. |
|
30 | - */ |
|
31 | - protected function _modify_validator() |
|
32 | - { |
|
33 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | - return; |
|
35 | - } |
|
27 | + /** |
|
28 | + * custom validator (restricting what was originally set by the messenger). |
|
29 | + * Note nothing is currently done for this messenger and message type. |
|
30 | + */ |
|
31 | + protected function _modify_validator() |
|
32 | + { |
|
33 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]'); |
|
34 | + return; |
|
35 | + } |
|
36 | 36 | } |
@@ -14,44 +14,44 @@ discard block |
||
14 | 14 | abstract class EE_Messages_Base extends EE_Base |
15 | 15 | { |
16 | 16 | |
17 | - /** DETAILS PROPERTIES **/ |
|
18 | - /** |
|
19 | - * The following are used to hold details on the type for reference (i.e. on admin screens) |
|
20 | - * and also used by the EE_message_type object to figure out where to get template data. |
|
21 | - */ |
|
22 | - public $name; |
|
23 | - public $description; |
|
24 | - protected $_messages_item_type; // messenger OR message_type? |
|
25 | - |
|
26 | - |
|
27 | - /** |
|
28 | - * This is an array describing the ui facing labels |
|
29 | - * that will be used whenever the messenger is referenced in the ui |
|
30 | - * |
|
31 | - * array( |
|
32 | - * 'singular' => __('something'), |
|
33 | - * 'plural' => __('somethings') |
|
34 | - * ) |
|
35 | - * |
|
36 | - * @var array |
|
37 | - */ |
|
38 | - public $label; |
|
39 | - |
|
40 | - |
|
41 | - |
|
42 | - |
|
43 | - /** |
|
44 | - * This property when set will hold the slugs of all EE admin pages that we will need to retrieve fields for |
|
45 | - * (and used to determine which callback method to call from the child class) |
|
46 | - * |
|
47 | - * structure should be |
|
48 | - * array( |
|
49 | - * 'page_action' => true |
|
50 | - * ) |
|
51 | - * |
|
17 | + /** DETAILS PROPERTIES **/ |
|
18 | + /** |
|
19 | + * The following are used to hold details on the type for reference (i.e. on admin screens) |
|
20 | + * and also used by the EE_message_type object to figure out where to get template data. |
|
21 | + */ |
|
22 | + public $name; |
|
23 | + public $description; |
|
24 | + protected $_messages_item_type; // messenger OR message_type? |
|
25 | + |
|
26 | + |
|
27 | + /** |
|
28 | + * This is an array describing the ui facing labels |
|
29 | + * that will be used whenever the messenger is referenced in the ui |
|
30 | + * |
|
31 | + * array( |
|
32 | + * 'singular' => __('something'), |
|
33 | + * 'plural' => __('somethings') |
|
34 | + * ) |
|
35 | + * |
|
36 | + * @var array |
|
37 | + */ |
|
38 | + public $label; |
|
39 | + |
|
40 | + |
|
41 | + |
|
42 | + |
|
43 | + /** |
|
44 | + * This property when set will hold the slugs of all EE admin pages that we will need to retrieve fields for |
|
45 | + * (and used to determine which callback method to call from the child class) |
|
46 | + * |
|
47 | + * structure should be |
|
48 | + * array( |
|
49 | + * 'page_action' => true |
|
50 | + * ) |
|
51 | + * |
|
52 | 52 | *@var array |
53 | - */ |
|
54 | - public $admin_registered_pages = array(); |
|
53 | + */ |
|
54 | + public $admin_registered_pages = array(); |
|
55 | 55 | |
56 | 56 | |
57 | 57 | |
@@ -60,264 +60,264 @@ discard block |
||
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * this property holds any specific fields for holding any settings related to a messenger (if any needed) |
|
65 | - * @var array |
|
66 | - */ |
|
67 | - protected $_admin_settings_fields = array(); |
|
63 | + /** |
|
64 | + * this property holds any specific fields for holding any settings related to a messenger (if any needed) |
|
65 | + * @var array |
|
66 | + */ |
|
67 | + protected $_admin_settings_fields = array(); |
|
68 | 68 | |
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | 72 | |
73 | - /** |
|
74 | - * this property will hold any existing settings that may have been set in the admin. |
|
75 | - * @var array |
|
76 | - */ |
|
77 | - protected $_existing_admin_settings = array(); |
|
73 | + /** |
|
74 | + * this property will hold any existing settings that may have been set in the admin. |
|
75 | + * @var array |
|
76 | + */ |
|
77 | + protected $_existing_admin_settings = array(); |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | 82 | |
83 | - /** |
|
84 | - * this property will hold an array of valid shortcodes for this message type and messengers. |
|
85 | - * #For Message Types: |
|
86 | - * This is an array of strings that correspond to defined EE_Shortcode libraries and per context. |
|
87 | - * For example: |
|
88 | - * array( 'admin' => array('transaction', 'event', 'attendee') ) |
|
89 | - * corresponds to 'EE_Transaction_Shortcodes.lib.php, EE_Event_Shortcodes.lib.php, EE_Attendee_Shortcodes.lib.php' |
|
90 | - * for the admin context; |
|
91 | - * |
|
92 | - * |
|
93 | - * #For Messengers: |
|
94 | - * For example: |
|
95 | - * array('subject' => array('transaction', 'event', 'attendee')) |
|
96 | - * corresponds to 'EE_Transaction_Shortcodes.lib.php, EE_Event_Shortcodes.lib.php, EE_Attendee_Shortcodes.lib.php' |
|
97 | - * for the 'subject' field; |
|
98 | - * NOTE: by default, with messengers, if the valid shortcodes for a field is left blank, |
|
99 | - * that field will inherit whatever are set as valid shortcodes by message_type. |
|
100 | - * This is so messenger can set specific valid codes for fields and leave other |
|
101 | - * valid shortcodes up to the message type matched with the messenger. |
|
102 | - * |
|
103 | - * @access protected |
|
104 | - * @var array |
|
105 | - */ |
|
106 | - protected $_valid_shortcodes = array(); |
|
83 | + /** |
|
84 | + * this property will hold an array of valid shortcodes for this message type and messengers. |
|
85 | + * #For Message Types: |
|
86 | + * This is an array of strings that correspond to defined EE_Shortcode libraries and per context. |
|
87 | + * For example: |
|
88 | + * array( 'admin' => array('transaction', 'event', 'attendee') ) |
|
89 | + * corresponds to 'EE_Transaction_Shortcodes.lib.php, EE_Event_Shortcodes.lib.php, EE_Attendee_Shortcodes.lib.php' |
|
90 | + * for the admin context; |
|
91 | + * |
|
92 | + * |
|
93 | + * #For Messengers: |
|
94 | + * For example: |
|
95 | + * array('subject' => array('transaction', 'event', 'attendee')) |
|
96 | + * corresponds to 'EE_Transaction_Shortcodes.lib.php, EE_Event_Shortcodes.lib.php, EE_Attendee_Shortcodes.lib.php' |
|
97 | + * for the 'subject' field; |
|
98 | + * NOTE: by default, with messengers, if the valid shortcodes for a field is left blank, |
|
99 | + * that field will inherit whatever are set as valid shortcodes by message_type. |
|
100 | + * This is so messenger can set specific valid codes for fields and leave other |
|
101 | + * valid shortcodes up to the message type matched with the messenger. |
|
102 | + * |
|
103 | + * @access protected |
|
104 | + * @var array |
|
105 | + */ |
|
106 | + protected $_valid_shortcodes = array(); |
|
107 | 107 | |
108 | 108 | |
109 | 109 | |
110 | 110 | |
111 | 111 | |
112 | - public function __construct() |
|
113 | - { |
|
114 | - $this->_set_admin_settings_fields(); |
|
115 | - $this->_set_valid_shortcodes(); |
|
116 | - $this->_set_admin_pages(); |
|
117 | - } |
|
112 | + public function __construct() |
|
113 | + { |
|
114 | + $this->_set_admin_settings_fields(); |
|
115 | + $this->_set_valid_shortcodes(); |
|
116 | + $this->_set_admin_pages(); |
|
117 | + } |
|
118 | 118 | |
119 | 119 | |
120 | 120 | |
121 | 121 | |
122 | 122 | |
123 | - /** |
|
124 | - * sets the _admin_settings_fields property which needs to be defined by child classes. |
|
125 | - * You will want to set the _admin_settings_fields properties as a multi-dimensional array with the following format |
|
126 | - * array( |
|
127 | - * {field_name - also used for setting index} => array( |
|
128 | - * 'field_type' => {type of field: 'text', 'textarea', 'checkbox'}, |
|
129 | - * 'value_type' => {type of value: 'string', 'int', 'array', 'bool'}, |
|
130 | - * 'required' => {bool, required or not}, |
|
131 | - * 'validation' => {bool, true if we want validation, false if not}, |
|
132 | - * 'format' => {%d, or %s}, |
|
133 | - * 'label' => {label for the field, make sure it's localized}, |
|
134 | - * 'default' => {default value for the setting} |
|
135 | - * ), |
|
136 | - * ); |
|
137 | - * |
|
138 | - * @abstract |
|
139 | - * @access protected |
|
140 | - * @return void |
|
141 | - */ |
|
142 | - abstract protected function _set_admin_settings_fields(); |
|
123 | + /** |
|
124 | + * sets the _admin_settings_fields property which needs to be defined by child classes. |
|
125 | + * You will want to set the _admin_settings_fields properties as a multi-dimensional array with the following format |
|
126 | + * array( |
|
127 | + * {field_name - also used for setting index} => array( |
|
128 | + * 'field_type' => {type of field: 'text', 'textarea', 'checkbox'}, |
|
129 | + * 'value_type' => {type of value: 'string', 'int', 'array', 'bool'}, |
|
130 | + * 'required' => {bool, required or not}, |
|
131 | + * 'validation' => {bool, true if we want validation, false if not}, |
|
132 | + * 'format' => {%d, or %s}, |
|
133 | + * 'label' => {label for the field, make sure it's localized}, |
|
134 | + * 'default' => {default value for the setting} |
|
135 | + * ), |
|
136 | + * ); |
|
137 | + * |
|
138 | + * @abstract |
|
139 | + * @access protected |
|
140 | + * @return void |
|
141 | + */ |
|
142 | + abstract protected function _set_admin_settings_fields(); |
|
143 | 143 | |
144 | 144 | |
145 | 145 | |
146 | 146 | |
147 | 147 | |
148 | - /** |
|
149 | - * sets any properties on whether a message type or messenger interface shows up on a ee administration page. |
|
150 | - * Child classes have to define this method but don't necessarily have to set the flags |
|
151 | - * as they will be set to false by default. |
|
152 | - * |
|
153 | - * Child classes use this method to set the `_admin_registered_page` property. |
|
154 | - * That property is to indicate what EE admin pages we have a corresponding callback for in the child class |
|
155 | - * so Message Type/messenger fields/content is included on that admin page. |
|
156 | - * |
|
157 | - * @abstract |
|
158 | - * @access protected |
|
159 | - * @return void |
|
160 | - */ |
|
161 | - abstract protected function _set_admin_pages(); |
|
148 | + /** |
|
149 | + * sets any properties on whether a message type or messenger interface shows up on a ee administration page. |
|
150 | + * Child classes have to define this method but don't necessarily have to set the flags |
|
151 | + * as they will be set to false by default. |
|
152 | + * |
|
153 | + * Child classes use this method to set the `_admin_registered_page` property. |
|
154 | + * That property is to indicate what EE admin pages we have a corresponding callback for in the child class |
|
155 | + * so Message Type/messenger fields/content is included on that admin page. |
|
156 | + * |
|
157 | + * @abstract |
|
158 | + * @access protected |
|
159 | + * @return void |
|
160 | + */ |
|
161 | + abstract protected function _set_admin_pages(); |
|
162 | 162 | |
163 | 163 | |
164 | 164 | |
165 | 165 | |
166 | 166 | |
167 | - /** |
|
168 | - * Child classes must declare the $_valid_shortcodes property using this method. |
|
169 | - * See comments for $_valid_shortcodes property for details on what it is used for. |
|
170 | - * |
|
171 | - * @access protected |
|
172 | - * @return void |
|
173 | - */ |
|
174 | - abstract protected function _set_valid_shortcodes(); |
|
167 | + /** |
|
168 | + * Child classes must declare the $_valid_shortcodes property using this method. |
|
169 | + * See comments for $_valid_shortcodes property for details on what it is used for. |
|
170 | + * |
|
171 | + * @access protected |
|
172 | + * @return void |
|
173 | + */ |
|
174 | + abstract protected function _set_valid_shortcodes(); |
|
175 | 175 | |
176 | 176 | |
177 | 177 | |
178 | - /** |
|
179 | - * sets the _existing_admin_settings property can be overridden by child classes. |
|
180 | - * We do this so we only do database calls if needed. |
|
181 | - * |
|
182 | - * @access protected |
|
183 | - * @param string $messenger |
|
184 | - */ |
|
185 | - protected function _set_existing_admin_settings($messenger = '') |
|
186 | - { |
|
187 | - /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
188 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
189 | - $active_messengers = $Message_Resource_Manager->get_active_messengers_option(); |
|
190 | - $settings_to_use = $active_messengers; |
|
191 | - |
|
192 | - /** |
|
193 | - * This determines what will be used for the getting the settings. |
|
194 | - */ |
|
195 | - if (! empty($messenger) |
|
196 | - && $Message_Resource_Manager->is_message_type_active_for_messenger($messenger, $this->name) |
|
197 | - ) { |
|
198 | - $settings_to_use = $active_messengers[ $messenger ]['settings'][ $messenger . '-message_types' ]; |
|
199 | - } |
|
200 | - |
|
201 | - $this->_existing_admin_settings = isset($settings_to_use[ $this->name ]['settings']) |
|
202 | - ? $settings_to_use[ $this->name ]['settings'] |
|
203 | - : null; |
|
204 | - } |
|
205 | - |
|
206 | - |
|
207 | - |
|
208 | - |
|
209 | - |
|
210 | - |
|
211 | - /** |
|
212 | - * get_existing_admin_settings |
|
213 | - * (if needed) sets and returns the _existing_admin_settings property. |
|
214 | - * |
|
215 | - * @access public |
|
216 | - * @param string $messenger |
|
217 | - * @return array settings |
|
218 | - */ |
|
219 | - public function get_existing_admin_settings($messenger = '') |
|
220 | - { |
|
221 | - // if admin_settings property empty lets try setting it. |
|
222 | - if (method_exists($this, '_set_existing_admin_settings') && empty($this->_existing_admin_settings)) { |
|
223 | - $this->_set_existing_admin_settings($messenger); |
|
224 | - } |
|
225 | - return property_exists($this, '_existing_admin_settings') |
|
226 | - ? $this->_existing_admin_settings |
|
227 | - : null; |
|
228 | - } |
|
229 | - |
|
230 | - |
|
231 | - |
|
232 | - |
|
233 | - |
|
234 | - |
|
235 | - /** |
|
236 | - * This returns the array of valid shortcodes for a message type or messenger as set by the child in the $_valid_shortcode property. |
|
237 | - * @return array an array of valid shortcodes. |
|
238 | - */ |
|
239 | - public function get_valid_shortcodes() |
|
240 | - { |
|
241 | - $valid_shortcodes = apply_filters( |
|
242 | - 'FHEE__' . get_class($this) . '__get_valid_shortcodes', |
|
243 | - $this->_valid_shortcodes, |
|
244 | - $this |
|
245 | - ); |
|
246 | - // The below filter applies to ALL messengers and message types so use with care! |
|
247 | - $valid_shortcodes = apply_filters('FHEE__EE_Messages_Base__get_valid_shortcodes', $valid_shortcodes, $this); |
|
248 | - return $valid_shortcodes; |
|
249 | - } |
|
250 | - |
|
251 | - |
|
252 | - |
|
253 | - |
|
254 | - /** |
|
255 | - * getter that returns the protected admin_settings_fields property |
|
256 | - * |
|
257 | - * @access public |
|
258 | - * @return array admin settings fields |
|
259 | - */ |
|
260 | - public function get_admin_settings_fields() |
|
261 | - { |
|
262 | - return $this->_admin_settings_fields; |
|
263 | - } |
|
264 | - |
|
265 | - |
|
266 | - |
|
267 | - |
|
268 | - |
|
269 | - /** |
|
270 | - * this public method accepts a page slug (for an EE_admin page) |
|
271 | - * and will return the response from the child class callback function |
|
272 | - * if that page is registered via the `_admin_registered_page` property set by the child class. |
|
273 | - * |
|
274 | - * @param string $page the slug of the EE admin page |
|
275 | - * @param array $actives an array of active message type (or messenger) objects. |
|
276 | - * @param string $action the page action (to allow for more specific handling - i.e. edit vs. add pages) |
|
277 | - * @param array $extra This is just an extra argument that can be used |
|
278 | - * to pass additional data for setting up page content. |
|
279 | - * @access protected |
|
280 | - * @return string $content for page. |
|
281 | - */ |
|
282 | - protected function _get_admin_page_content($page, $action, $extra, $actives) |
|
283 | - { |
|
284 | - // we can also further refine the context by action (if present). |
|
285 | - if (!empty($action)) { |
|
286 | - $page = $page . '_' . $action; |
|
287 | - } |
|
288 | - |
|
289 | - if (!isset($this->admin_registered_pages[ $page ])) { |
|
290 | - // todo: a place to throw an exception? |
|
291 | - // We need to indicate there is no registered page so this function is not being called correctly. |
|
292 | - return false; |
|
293 | - } |
|
294 | - // k made it here so let's call the method |
|
295 | - $content = call_user_func_array( |
|
296 | - array( $this, '_get_admin_content_' . $page ), |
|
297 | - array( $actives, $extra ) |
|
298 | - ); |
|
299 | - if ($content === false) { |
|
300 | - // todo this needs to be an exception once we've got exceptions in place. |
|
301 | - return false; |
|
302 | - } |
|
303 | - return $content; |
|
304 | - } |
|
305 | - |
|
306 | - |
|
307 | - /** |
|
308 | - * Allows a message type to specifically exclude template fields for the provided messenger. |
|
309 | - * Filtered so this can be programmatically altered as well. |
|
310 | - * @param string $messenger_name name of messenger |
|
311 | - * @return array |
|
312 | - */ |
|
313 | - public function excludedFieldsForMessenger($messenger_name) |
|
314 | - { |
|
315 | - return apply_filters( |
|
316 | - 'FHEE__EE_Messages_Base__excludedFieldForMessenger', |
|
317 | - array(), |
|
318 | - $messenger_name, |
|
319 | - $this->name, |
|
320 | - $this |
|
321 | - ); |
|
322 | - } |
|
178 | + /** |
|
179 | + * sets the _existing_admin_settings property can be overridden by child classes. |
|
180 | + * We do this so we only do database calls if needed. |
|
181 | + * |
|
182 | + * @access protected |
|
183 | + * @param string $messenger |
|
184 | + */ |
|
185 | + protected function _set_existing_admin_settings($messenger = '') |
|
186 | + { |
|
187 | + /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
188 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
189 | + $active_messengers = $Message_Resource_Manager->get_active_messengers_option(); |
|
190 | + $settings_to_use = $active_messengers; |
|
191 | + |
|
192 | + /** |
|
193 | + * This determines what will be used for the getting the settings. |
|
194 | + */ |
|
195 | + if (! empty($messenger) |
|
196 | + && $Message_Resource_Manager->is_message_type_active_for_messenger($messenger, $this->name) |
|
197 | + ) { |
|
198 | + $settings_to_use = $active_messengers[ $messenger ]['settings'][ $messenger . '-message_types' ]; |
|
199 | + } |
|
200 | + |
|
201 | + $this->_existing_admin_settings = isset($settings_to_use[ $this->name ]['settings']) |
|
202 | + ? $settings_to_use[ $this->name ]['settings'] |
|
203 | + : null; |
|
204 | + } |
|
205 | + |
|
206 | + |
|
207 | + |
|
208 | + |
|
209 | + |
|
210 | + |
|
211 | + /** |
|
212 | + * get_existing_admin_settings |
|
213 | + * (if needed) sets and returns the _existing_admin_settings property. |
|
214 | + * |
|
215 | + * @access public |
|
216 | + * @param string $messenger |
|
217 | + * @return array settings |
|
218 | + */ |
|
219 | + public function get_existing_admin_settings($messenger = '') |
|
220 | + { |
|
221 | + // if admin_settings property empty lets try setting it. |
|
222 | + if (method_exists($this, '_set_existing_admin_settings') && empty($this->_existing_admin_settings)) { |
|
223 | + $this->_set_existing_admin_settings($messenger); |
|
224 | + } |
|
225 | + return property_exists($this, '_existing_admin_settings') |
|
226 | + ? $this->_existing_admin_settings |
|
227 | + : null; |
|
228 | + } |
|
229 | + |
|
230 | + |
|
231 | + |
|
232 | + |
|
233 | + |
|
234 | + |
|
235 | + /** |
|
236 | + * This returns the array of valid shortcodes for a message type or messenger as set by the child in the $_valid_shortcode property. |
|
237 | + * @return array an array of valid shortcodes. |
|
238 | + */ |
|
239 | + public function get_valid_shortcodes() |
|
240 | + { |
|
241 | + $valid_shortcodes = apply_filters( |
|
242 | + 'FHEE__' . get_class($this) . '__get_valid_shortcodes', |
|
243 | + $this->_valid_shortcodes, |
|
244 | + $this |
|
245 | + ); |
|
246 | + // The below filter applies to ALL messengers and message types so use with care! |
|
247 | + $valid_shortcodes = apply_filters('FHEE__EE_Messages_Base__get_valid_shortcodes', $valid_shortcodes, $this); |
|
248 | + return $valid_shortcodes; |
|
249 | + } |
|
250 | + |
|
251 | + |
|
252 | + |
|
253 | + |
|
254 | + /** |
|
255 | + * getter that returns the protected admin_settings_fields property |
|
256 | + * |
|
257 | + * @access public |
|
258 | + * @return array admin settings fields |
|
259 | + */ |
|
260 | + public function get_admin_settings_fields() |
|
261 | + { |
|
262 | + return $this->_admin_settings_fields; |
|
263 | + } |
|
264 | + |
|
265 | + |
|
266 | + |
|
267 | + |
|
268 | + |
|
269 | + /** |
|
270 | + * this public method accepts a page slug (for an EE_admin page) |
|
271 | + * and will return the response from the child class callback function |
|
272 | + * if that page is registered via the `_admin_registered_page` property set by the child class. |
|
273 | + * |
|
274 | + * @param string $page the slug of the EE admin page |
|
275 | + * @param array $actives an array of active message type (or messenger) objects. |
|
276 | + * @param string $action the page action (to allow for more specific handling - i.e. edit vs. add pages) |
|
277 | + * @param array $extra This is just an extra argument that can be used |
|
278 | + * to pass additional data for setting up page content. |
|
279 | + * @access protected |
|
280 | + * @return string $content for page. |
|
281 | + */ |
|
282 | + protected function _get_admin_page_content($page, $action, $extra, $actives) |
|
283 | + { |
|
284 | + // we can also further refine the context by action (if present). |
|
285 | + if (!empty($action)) { |
|
286 | + $page = $page . '_' . $action; |
|
287 | + } |
|
288 | + |
|
289 | + if (!isset($this->admin_registered_pages[ $page ])) { |
|
290 | + // todo: a place to throw an exception? |
|
291 | + // We need to indicate there is no registered page so this function is not being called correctly. |
|
292 | + return false; |
|
293 | + } |
|
294 | + // k made it here so let's call the method |
|
295 | + $content = call_user_func_array( |
|
296 | + array( $this, '_get_admin_content_' . $page ), |
|
297 | + array( $actives, $extra ) |
|
298 | + ); |
|
299 | + if ($content === false) { |
|
300 | + // todo this needs to be an exception once we've got exceptions in place. |
|
301 | + return false; |
|
302 | + } |
|
303 | + return $content; |
|
304 | + } |
|
305 | + |
|
306 | + |
|
307 | + /** |
|
308 | + * Allows a message type to specifically exclude template fields for the provided messenger. |
|
309 | + * Filtered so this can be programmatically altered as well. |
|
310 | + * @param string $messenger_name name of messenger |
|
311 | + * @return array |
|
312 | + */ |
|
313 | + public function excludedFieldsForMessenger($messenger_name) |
|
314 | + { |
|
315 | + return apply_filters( |
|
316 | + 'FHEE__EE_Messages_Base__excludedFieldForMessenger', |
|
317 | + array(), |
|
318 | + $messenger_name, |
|
319 | + $this->name, |
|
320 | + $this |
|
321 | + ); |
|
322 | + } |
|
323 | 323 | } |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | /** |
193 | 193 | * This determines what will be used for the getting the settings. |
194 | 194 | */ |
195 | - if (! empty($messenger) |
|
195 | + if ( ! empty($messenger) |
|
196 | 196 | && $Message_Resource_Manager->is_message_type_active_for_messenger($messenger, $this->name) |
197 | 197 | ) { |
198 | - $settings_to_use = $active_messengers[ $messenger ]['settings'][ $messenger . '-message_types' ]; |
|
198 | + $settings_to_use = $active_messengers[$messenger]['settings'][$messenger.'-message_types']; |
|
199 | 199 | } |
200 | 200 | |
201 | - $this->_existing_admin_settings = isset($settings_to_use[ $this->name ]['settings']) |
|
202 | - ? $settings_to_use[ $this->name ]['settings'] |
|
201 | + $this->_existing_admin_settings = isset($settings_to_use[$this->name]['settings']) |
|
202 | + ? $settings_to_use[$this->name]['settings'] |
|
203 | 203 | : null; |
204 | 204 | } |
205 | 205 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | public function get_valid_shortcodes() |
240 | 240 | { |
241 | 241 | $valid_shortcodes = apply_filters( |
242 | - 'FHEE__' . get_class($this) . '__get_valid_shortcodes', |
|
242 | + 'FHEE__'.get_class($this).'__get_valid_shortcodes', |
|
243 | 243 | $this->_valid_shortcodes, |
244 | 244 | $this |
245 | 245 | ); |
@@ -282,19 +282,19 @@ discard block |
||
282 | 282 | protected function _get_admin_page_content($page, $action, $extra, $actives) |
283 | 283 | { |
284 | 284 | // we can also further refine the context by action (if present). |
285 | - if (!empty($action)) { |
|
286 | - $page = $page . '_' . $action; |
|
285 | + if ( ! empty($action)) { |
|
286 | + $page = $page.'_'.$action; |
|
287 | 287 | } |
288 | 288 | |
289 | - if (!isset($this->admin_registered_pages[ $page ])) { |
|
289 | + if ( ! isset($this->admin_registered_pages[$page])) { |
|
290 | 290 | // todo: a place to throw an exception? |
291 | 291 | // We need to indicate there is no registered page so this function is not being called correctly. |
292 | 292 | return false; |
293 | 293 | } |
294 | 294 | // k made it here so let's call the method |
295 | 295 | $content = call_user_func_array( |
296 | - array( $this, '_get_admin_content_' . $page ), |
|
297 | - array( $actives, $extra ) |
|
296 | + array($this, '_get_admin_content_'.$page), |
|
297 | + array($actives, $extra) |
|
298 | 298 | ); |
299 | 299 | if ($content === false) { |
300 | 300 | // todo this needs to be an exception once we've got exceptions in place. |