Completed
Branch decaf-fixes/main (0c91cf)
by
unknown
07:32 queued 02:36
created
caffeinated/admin/extend/events/help_tabs/import_page.help_tab.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <p><strong><?php _e('Importing CSV Event Espresso Data', 'event_espresso'); ?></strong></p>
2 2
 <p>
3 3
     <?php _e(
4
-        'The importer can be used to import event information into Event Espresso using a CSV file.',
5
-        'event_espresso'
6
-    ); ?>
4
+		'The importer can be used to import event information into Event Espresso using a CSV file.',
5
+		'event_espresso'
6
+	); ?>
7 7
 </p>
8 8
 <p><strong><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso'); ?></strong></p>
9 9
 <p>
10 10
     <?php _e(
11
-        'To import Event Espresso data from another Event Espresso 4 install, export a CSV file from the admin Events overview page, or anywhere you can generate a CSV export file from. Then upload that file here (regardless of what type of information was exported).',
12
-        'event_espresso'
13
-    ); ?>
11
+		'To import Event Espresso data from another Event Espresso 4 install, export a CSV file from the admin Events overview page, or anywhere you can generate a CSV export file from. Then upload that file here (regardless of what type of information was exported).',
12
+		'event_espresso'
13
+	); ?>
14 14
 </p>
15 15
 <p>
16 16
     <?php _e(
17
-        'Note: its possible that data from the other site have the same IDs as data in this site. The importer recognizes that this data is from a different database and inserts new items for each item in the CSV file, regardless of whether its ID matches that of an item in this site\'s database or not. However, the importer also remembers the mapping from the old site\'s database to this site\'s database, and on subsequent CSV importers from that site, the data in this database will be updated instead of re-inserting new items.',
18
-        'event_espresso'
19
-    ); ?>
17
+		'Note: its possible that data from the other site have the same IDs as data in this site. The importer recognizes that this data is from a different database and inserts new items for each item in the CSV file, regardless of whether its ID matches that of an item in this site\'s database or not. However, the importer also remembers the mapping from the old site\'s database to this site\'s database, and on subsequent CSV importers from that site, the data in this database will be updated instead of re-inserting new items.',
18
+		'event_espresso'
19
+	); ?>
20 20
 </p>
21 21
 <p><strong><?php _e("Importing from this Site", 'event_espresso'); ?></strong></p>
22 22
 <p><?php
23
-    _e(
24
-        "You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).",
25
-        'event_espresso'
26
-    ); ?></p>
23
+	_e(
24
+		"You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).",
25
+		'event_espresso'
26
+	); ?></p>
27 27
 
28 28
 <p><strong><?php _e("Notes about Generating your own CSV Import Files", "event_espresso"); ?></strong></p>
29 29
 <p><?php
30
-    _e(
31
-        "If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.",
32
-        "event_espresso"
33
-    ); ?></p>
30
+	_e(
31
+		"If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.",
32
+		"event_espresso"
33
+	); ?></p>
34 34
 <p><?php
35
-    _e(
36
-        "The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ",
37
-        "event_espresso"
38
-    ); ?></p>
35
+	_e(
36
+		"The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ",
37
+		"event_espresso"
38
+	); ?></p>
39 39
 <p><?php
40
-    _e(
41
-        "In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)",
42
-        "event_espresso"
43
-    ); ?></p>
40
+	_e(
41
+		"In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)",
42
+		"event_espresso"
43
+	); ?></p>
44 44
 <p><?php
45
-    _e(
46
-        "Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)",
47
-        "event_espresso"
48
-    ); ?></p>
49 45
\ No newline at end of file
46
+	_e(
47
+		"Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)",
48
+		"event_espresso"
49
+	); ?></p>
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/templates/import_page.template.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <div class="import-area">
2 2
     <div class="important-notice">
3 3
         <?php _e(
4
-            'The import feature has been disabled because of bugs. It is expected to be put back in place soon.',
5
-            'event_espresso'
6
-        ); ?>
4
+			'The import feature has been disabled because of bugs. It is expected to be put back in place soon.',
5
+			'event_espresso'
6
+		); ?>
7 7
     </div>
8 8
     <?php // echo $form?>
9 9
 </div>
Please login to merge, or discard this patch.
admin/extend/events/templates/event_type_metabox_contents.template.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
     </ul>
5 5
     <div id="espresso_event_type-all" class="tabs-panel">
6 6
         <?php
7
-        $name = 'tax_input[espresso_event_type]';
8
-        echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
9
-        ?>
7
+		$name = 'tax_input[espresso_event_type]';
8
+		echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
9
+		?>
10 10
         <ul id="espresso_event_typechecklist" data-wp-lists="list:espresso_event_type"
11 11
             class="categorychecklist form-no-clear">
12 12
             <?php echo $radio_list; ?>
Please login to merge, or discard this patch.
extend/registration_form/templates/questions_in_group_meta_box.template.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@
 block discarded – undo
3 3
 assert($question_group instanceof EE_Question_Group);
4 4
 assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions
5 5
 foreach ($all_questions as $question_option) {
6
-    assert($question_option);
7
-    assert($question_option instanceof EE_Question);
6
+	assert($question_option);
7
+	assert($question_option instanceof EE_Question);
8 8
 }
9 9
 ?>
10 10
 <h4><?php _e('Check off all questions that you wish to appear in this group.', 'event_espresso'); ?></h4>
11 11
 <ul>
12 12
     <?php
13
-    foreach ($all_questions as $question_ID => $question) {
14
-        /*@var $question EE_Question*/
15
-        $checked = array_key_exists($question_ID, $question_group->questions()) ? ' checked="checked"' : '';
16
-        ?>
13
+	foreach ($all_questions as $question_ID => $question) {
14
+		/*@var $question EE_Question*/
15
+		$checked = array_key_exists($question_ID, $question_group->questions()) ? ' checked="checked"' : '';
16
+		?>
17 17
         <li>
18 18
             <label for="question-<?php echo $question_ID ?>">
19 19
                 <input type="checkbox" name="questions[<?php echo $question_ID; ?>]"
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 // required variables for template:
3 3
 assert($question_group instanceof EE_Question_Group);
4
-assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions
4
+assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions))); // list of unused questions
5 5
 foreach ($all_questions as $question_option) {
6 6
     assert($question_option);
7 7
     assert($question_option instanceof EE_Question);
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_attendee_list.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
 <li class="ticket-registration">
7 7
     <table class="registration-details">
8 8
         <tr class="odd">
9
-            <th><?php	_e('Attendee', 'event_espresso');?></th>
9
+            <th><?php	_e('Attendee', 'event_espresso'); ?></th>
10 10
             <td>[FNAME] [LNAME] ([ATTENDEE_EMAIL])</td>
11 11
         </tr>
12 12
         <tr>
13
-            <th><?php _e("Registration Code:", "event_espresso");?></th>
13
+            <th><?php _e("Registration Code:", "event_espresso"); ?></th>
14 14
             <td>[REGISTRATION_CODE] - <span class="[REGISTRATION_STATUS_ID]">[REGISTRATION_STATUS_LABEL]</span></td>
15 15
         </tr>
16 16
         <tr>
Please login to merge, or discard this patch.
payment_declined/EE_Messages_Email_Payment_Declined_Validator.class.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -15,37 +15,37 @@
 block discarded – undo
15 15
 {
16 16
 
17 17
 
18
-    public function __construct($fields, $context)
19
-    {
20
-        $this->_m_name = 'email';
21
-        $this->_mt_name = 'payment_declined';
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_declined';
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
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,18 +32,18 @@
 block discarded – undo
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]');
Please login to merge, or discard this patch.
message_type/newsletter/EE_Messages_Email_Newsletter_Validator.class.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -11,72 +11,72 @@
 block discarded – undo
11 11
  */
12 12
 class EE_Messages_Email_Newsletter_Validator extends EE_Messages_Validator
13 13
 {
14
-    /**
15
-     * EE_Messages_Email_Newsletter_Validator constructor.
16
-     *
17
-     * @param array $fields
18
-     * @param string $context
19
-     * @throws EE_Error
20
-     * @throws ReflectionException
21
-     */
22
-    public function __construct(array $fields, $context)
23
-    {
24
-        $this->_m_name = 'email';
25
-        $this->_mt_name = 'newsletter';
14
+	/**
15
+	 * EE_Messages_Email_Newsletter_Validator constructor.
16
+	 *
17
+	 * @param array $fields
18
+	 * @param string $context
19
+	 * @throws EE_Error
20
+	 * @throws ReflectionException
21
+	 */
22
+	public function __construct(array $fields, $context)
23
+	{
24
+		$this->_m_name = 'email';
25
+		$this->_mt_name = 'newsletter';
26 26
 
27
-        parent::__construct($fields, $context);
28
-    }
27
+		parent::__construct($fields, $context);
28
+	}
29 29
 
30
-    /**
31
-     * custom validator (restricting what was originally set by the messenger)
32
-     */
33
-    protected function _modify_validator()
34
-    {
35
-        if ($this->_context === 'attendee') {
36
-            $this->_valid_shortcodes_modifier[ $this->_context ]['from'] = array(
37
-                'recipient_details',
38
-                'email',
39
-                'organization',
40
-            );
41
-        }
30
+	/**
31
+	 * custom validator (restricting what was originally set by the messenger)
32
+	 */
33
+	protected function _modify_validator()
34
+	{
35
+		if ($this->_context === 'attendee') {
36
+			$this->_valid_shortcodes_modifier[ $this->_context ]['from'] = array(
37
+				'recipient_details',
38
+				'email',
39
+				'organization',
40
+			);
41
+		}
42 42
 
43
-        // excluded shortcodes
44
-        $fields = array('to', 'from', 'subject', 'content', 'newsletter_content');
45
-        foreach ($fields as $field) {
46
-            $this->_specific_shortcode_excludes[ $field ] = array(
47
-                '[RECIPIENT_REGISTRATION_CODE]',
48
-                '[EVENT_AUTHOR_FORMATTED_EMAIL]',
49
-                '[EVENT_AUTHOR_EMAIL]',
50
-            );
51
-        }
52
-        $add_excludes = array(
53
-            '[RECIPIENT_FNAME]',
54
-            '[RECIPIENT_LNAME]',
55
-            '[RECIPIENT_EMAIL]',
56
-            '[COMPANY]',
57
-            '[CO_ADD1]',
58
-            '[CO_ADD2]',
59
-            '[CO_CITY]',
60
-            '[CO_STATE]',
61
-            '[CO_ZIP]',
62
-            '[CO_LOGO]',
63
-            '[CO_PHONE]',
64
-            '[CO_LOGO_URL]',
65
-            '[CO_FACEBOOK_URL]',
66
-            '[CO_TWITTER_URL]',
67
-            '[CO_PINTEREST_URL]',
68
-            '[CO_GOOGLE_URL]',
69
-            '[CO_LINKEDIN_URL]',
70
-            '[CO_INSTAGRAM_URL]',
71
-        );
72
-        $this->_specific_shortcode_excludes['from'] =
73
-            array_merge(
74
-                $this->_specific_shortcode_excludes['from'],
75
-                $add_excludes
76
-            );
77
-        $this->_specific_shortcode_excludes['content'] = array_merge(
78
-            $this->_specific_shortcode_excludes['content'],
79
-            array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]')
80
-        );
81
-    }
43
+		// excluded shortcodes
44
+		$fields = array('to', 'from', 'subject', 'content', 'newsletter_content');
45
+		foreach ($fields as $field) {
46
+			$this->_specific_shortcode_excludes[ $field ] = array(
47
+				'[RECIPIENT_REGISTRATION_CODE]',
48
+				'[EVENT_AUTHOR_FORMATTED_EMAIL]',
49
+				'[EVENT_AUTHOR_EMAIL]',
50
+			);
51
+		}
52
+		$add_excludes = array(
53
+			'[RECIPIENT_FNAME]',
54
+			'[RECIPIENT_LNAME]',
55
+			'[RECIPIENT_EMAIL]',
56
+			'[COMPANY]',
57
+			'[CO_ADD1]',
58
+			'[CO_ADD2]',
59
+			'[CO_CITY]',
60
+			'[CO_STATE]',
61
+			'[CO_ZIP]',
62
+			'[CO_LOGO]',
63
+			'[CO_PHONE]',
64
+			'[CO_LOGO_URL]',
65
+			'[CO_FACEBOOK_URL]',
66
+			'[CO_TWITTER_URL]',
67
+			'[CO_PINTEREST_URL]',
68
+			'[CO_GOOGLE_URL]',
69
+			'[CO_LINKEDIN_URL]',
70
+			'[CO_INSTAGRAM_URL]',
71
+		);
72
+		$this->_specific_shortcode_excludes['from'] =
73
+			array_merge(
74
+				$this->_specific_shortcode_excludes['from'],
75
+				$add_excludes
76
+			);
77
+		$this->_specific_shortcode_excludes['content'] = array_merge(
78
+			$this->_specific_shortcode_excludes['content'],
79
+			array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]')
80
+		);
81
+	}
82 82
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     protected function _modify_validator()
34 34
     {
35 35
         if ($this->_context === 'attendee') {
36
-            $this->_valid_shortcodes_modifier[ $this->_context ]['from'] = array(
36
+            $this->_valid_shortcodes_modifier[$this->_context]['from'] = array(
37 37
                 'recipient_details',
38 38
                 'email',
39 39
                 'organization',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         // excluded shortcodes
44 44
         $fields = array('to', 'from', 'subject', 'content', 'newsletter_content');
45 45
         foreach ($fields as $field) {
46
-            $this->_specific_shortcode_excludes[ $field ] = array(
46
+            $this->_specific_shortcode_excludes[$field] = array(
47 47
                 '[RECIPIENT_REGISTRATION_CODE]',
48 48
                 '[EVENT_AUTHOR_FORMATTED_EMAIL]',
49 49
                 '[EVENT_AUTHOR_EMAIL]',
Please login to merge, or discard this patch.
messages/message_type/newsletter/EE_Newsletter_message_type.class.php 2 patches
Indentation   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -13,194 +13,194 @@
 block discarded – undo
13 13
 class EE_Newsletter_message_type extends EE_message_type
14 14
 {
15 15
 
16
-    public function __construct()
17
-    {
18
-        $this->name = 'newsletter';
19
-        $this->description = esc_html__(
20
-            'Batch message type messages are triggered manually by the admin for sending notifications to a selected group of recipients. This should only be used for more general notification type messages that contain information specific for the recipients. For "newsletter" type messages we recommend using an email list service like MailChimp, because sending non-related mail-outs to contacts increases the risk of your site domain getting added to spam lists, which will prevent messages getting to users.',
21
-            'event_espresso'
22
-        );
23
-        $this->label = array(
24
-            'singular' => esc_html__('batch', 'event_espresso'),
25
-            'plural'   => esc_html__('batches', 'event_espresso'),
26
-        );
27
-        $this->_master_templates = array(
28
-            'email' => 'registration',
29
-        );
30
-
31
-        parent::__construct();
32
-    }
33
-
34
-
35
-    /**
36
-     * Sets admin_registered_pages property
37
-     */
38
-    protected function _set_admin_pages()
39
-    {
40
-        $this->admin_registered_pages = array(); // no admin pages to register this with.
41
-    }
42
-
43
-
44
-    /**
45
-     * Sets property related to data handler.
46
-     */
47
-    protected function _set_data_handler()
48
-    {
49
-        $this->_data_handler = 'Registrations';
50
-        $this->_single_message = $this->_data instanceof EE_Registration;
51
-    }
52
-
53
-
54
-    /**
55
-     * Returns the data for the given context for this message type.
56
-     * @param string          $context
57
-     * @param EE_Registration $registration
58
-     * @param int             $id
59
-     * @return array|mixed
60
-     */
61
-    protected function _get_data_for_context($context, EE_Registration $registration, $id)
62
-    {
63
-        // newsletter message type data handler is 'Registrations' and it expects an array of EE_Registration objects.
64
-        return array($registration);
65
-    }
66
-
67
-
68
-    /**
69
-     * Sets the admin settings fields property for this message type.
70
-     */
71
-    protected function _set_admin_settings_fields()
72
-    {
73
-        $this->_admin_settings_fields = array();
74
-    }
75
-
76
-
77
-    /**
78
-     * Sets the contexts for this message type.
79
-     */
80
-    protected function _set_contexts()
81
-    {
82
-        $this->_context_label = array(
83
-            'label'       => esc_html__('recipient', 'event_espresso'),
84
-            'plural'      => esc_html__('recipients', 'event_espresso'),
85
-            'description' => esc_html__('Recipient\'s are who will receive the message.', 'event_espresso'),
86
-        );
87
-
88
-        $this->_contexts = array(
89
-            'attendee' => array(
90
-                'label'       => esc_html__('Registrant', 'event_espresso'),
91
-                'description' => esc_html__('This template goes to selected registrants.', 'event_espresso'),
92
-            ),
93
-        );
94
-    }
95
-
96
-
97
-    /**
98
-     * used to set the valid shortcodes.
99
-     * For the newsletter message type we only have two valid shortcode libraries in use, recipient details and
100
-     * organization.  That's it!
101
-     *
102
-     * @since   4.3.0
103
-     * @return  void
104
-     */
105
-    protected function _set_valid_shortcodes()
106
-    {
107
-        parent::_set_valid_shortcodes();
108
-
109
-        $included_shortcodes = array(
110
-            'recipient_details',
111
-            'organization',
112
-            'newsletter',
113
-        );
114
-
115
-        foreach ($this->_valid_shortcodes as $context => $shortcodes) {
116
-            foreach ($shortcodes as $key => $shortcode) {
117
-                if (! in_array($shortcode, $included_shortcodes, true)) {
118
-                    unset($this->_valid_shortcodes[ $context ][ $key ]);
119
-                }
120
-            }
121
-            $this->_valid_shortcodes[ $context ][] = 'newsletter';
122
-        }
123
-    }
124
-
125
-
126
-    /**
127
-     * Override default _attendee_addressees in EE_message_type because we want to loop through the registrations
128
-     * for EE_message_type.
129
-     *
130
-     * @return array
131
-     * @throws EE_Error
132
-     * @throws InvalidArgumentException
133
-     * @throws ReflectionException
134
-     * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
135
-     * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
136
-     */
137
-    protected function _attendee_addressees()
138
-    {
139
-        $addressee = array();
140
-
141
-        // looping through registrations
142
-        foreach ($this->_data->registrations as $reg_id => $details) {
143
-            // set $attendee array to blank on each loop
144
-            $aee = array();
145
-
146
-            // need to get the attendee from this registration.
147
-            $attendee = isset($details['att_obj']) && $details['att_obj'] instanceof EE_Attendee
148
-                ? $details['att_obj']
149
-                : null;
150
-
151
-            if (! $attendee instanceof EE_Attendee) {
152
-                continue;
153
-            }
154
-
155
-            // set $aee from attendee object
156
-            $aee['att_obj'] = $attendee;
157
-            $aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs'])
158
-                ? $this->_data->attendees[ $attendee->ID() ]['reg_objs']
159
-                : array();
160
-            $aee['attendee_email'] = $attendee->email();
161
-            $aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs'])
162
-                ? $this->_data->attendees[ $attendee->ID() ]['tkt_objs']
163
-                : array();
164
-
165
-            if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) {
166
-                $aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
167
-                $aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
168
-            } else {
169
-                $aee['evt_objs'] = $aee['events'] = array();
170
-            }
171
-
172
-            $aee['reg_obj'] = isset($details['reg_obj'])
173
-                ? $details['reg_obj']
174
-                : null;
175
-            $aee['attendees'] = $this->_data->attendees;
176
-
177
-            // merge in the primary attendee data
178
-            $aee = array_merge($this->_default_addressee_data, $aee);
179
-
180
-            // make sure txn is set
181
-            if (empty($aee['txn']) && $aee['reg_obj'] instanceof EE_Registration) {
182
-                $aee['txn'] = $aee['reg_obj']->transaction();
183
-            }
184
-
185
-            $addressee[] = new EE_Messages_Addressee($aee);
186
-        }
187
-        return $addressee;
188
-    }
189
-
190
-    /**
191
-     * Allows a message type to specifically exclude template fields for the provided messenger.
192
-     * Filtered so this can be programmatically altered as well.
193
-     *
194
-     * @param string $messenger_name name of messenger
195
-     * @return array
196
-     */
197
-    public function excludedFieldsForMessenger($messenger_name)
198
-    {
199
-        $excluded_fields = array(
200
-            'email' => array('cc')
201
-        );
202
-        return isset($excluded_fields[ $messenger_name ])
203
-            ? $excluded_fields[ $messenger_name ]
204
-            : parent::excludedFieldsForMessenger($messenger_name);
205
-    }
16
+	public function __construct()
17
+	{
18
+		$this->name = 'newsletter';
19
+		$this->description = esc_html__(
20
+			'Batch message type messages are triggered manually by the admin for sending notifications to a selected group of recipients. This should only be used for more general notification type messages that contain information specific for the recipients. For "newsletter" type messages we recommend using an email list service like MailChimp, because sending non-related mail-outs to contacts increases the risk of your site domain getting added to spam lists, which will prevent messages getting to users.',
21
+			'event_espresso'
22
+		);
23
+		$this->label = array(
24
+			'singular' => esc_html__('batch', 'event_espresso'),
25
+			'plural'   => esc_html__('batches', 'event_espresso'),
26
+		);
27
+		$this->_master_templates = array(
28
+			'email' => 'registration',
29
+		);
30
+
31
+		parent::__construct();
32
+	}
33
+
34
+
35
+	/**
36
+	 * Sets admin_registered_pages property
37
+	 */
38
+	protected function _set_admin_pages()
39
+	{
40
+		$this->admin_registered_pages = array(); // no admin pages to register this with.
41
+	}
42
+
43
+
44
+	/**
45
+	 * Sets property related to data handler.
46
+	 */
47
+	protected function _set_data_handler()
48
+	{
49
+		$this->_data_handler = 'Registrations';
50
+		$this->_single_message = $this->_data instanceof EE_Registration;
51
+	}
52
+
53
+
54
+	/**
55
+	 * Returns the data for the given context for this message type.
56
+	 * @param string          $context
57
+	 * @param EE_Registration $registration
58
+	 * @param int             $id
59
+	 * @return array|mixed
60
+	 */
61
+	protected function _get_data_for_context($context, EE_Registration $registration, $id)
62
+	{
63
+		// newsletter message type data handler is 'Registrations' and it expects an array of EE_Registration objects.
64
+		return array($registration);
65
+	}
66
+
67
+
68
+	/**
69
+	 * Sets the admin settings fields property for this message type.
70
+	 */
71
+	protected function _set_admin_settings_fields()
72
+	{
73
+		$this->_admin_settings_fields = array();
74
+	}
75
+
76
+
77
+	/**
78
+	 * Sets the contexts for this message type.
79
+	 */
80
+	protected function _set_contexts()
81
+	{
82
+		$this->_context_label = array(
83
+			'label'       => esc_html__('recipient', 'event_espresso'),
84
+			'plural'      => esc_html__('recipients', 'event_espresso'),
85
+			'description' => esc_html__('Recipient\'s are who will receive the message.', 'event_espresso'),
86
+		);
87
+
88
+		$this->_contexts = array(
89
+			'attendee' => array(
90
+				'label'       => esc_html__('Registrant', 'event_espresso'),
91
+				'description' => esc_html__('This template goes to selected registrants.', 'event_espresso'),
92
+			),
93
+		);
94
+	}
95
+
96
+
97
+	/**
98
+	 * used to set the valid shortcodes.
99
+	 * For the newsletter message type we only have two valid shortcode libraries in use, recipient details and
100
+	 * organization.  That's it!
101
+	 *
102
+	 * @since   4.3.0
103
+	 * @return  void
104
+	 */
105
+	protected function _set_valid_shortcodes()
106
+	{
107
+		parent::_set_valid_shortcodes();
108
+
109
+		$included_shortcodes = array(
110
+			'recipient_details',
111
+			'organization',
112
+			'newsletter',
113
+		);
114
+
115
+		foreach ($this->_valid_shortcodes as $context => $shortcodes) {
116
+			foreach ($shortcodes as $key => $shortcode) {
117
+				if (! in_array($shortcode, $included_shortcodes, true)) {
118
+					unset($this->_valid_shortcodes[ $context ][ $key ]);
119
+				}
120
+			}
121
+			$this->_valid_shortcodes[ $context ][] = 'newsletter';
122
+		}
123
+	}
124
+
125
+
126
+	/**
127
+	 * Override default _attendee_addressees in EE_message_type because we want to loop through the registrations
128
+	 * for EE_message_type.
129
+	 *
130
+	 * @return array
131
+	 * @throws EE_Error
132
+	 * @throws InvalidArgumentException
133
+	 * @throws ReflectionException
134
+	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
135
+	 * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
136
+	 */
137
+	protected function _attendee_addressees()
138
+	{
139
+		$addressee = array();
140
+
141
+		// looping through registrations
142
+		foreach ($this->_data->registrations as $reg_id => $details) {
143
+			// set $attendee array to blank on each loop
144
+			$aee = array();
145
+
146
+			// need to get the attendee from this registration.
147
+			$attendee = isset($details['att_obj']) && $details['att_obj'] instanceof EE_Attendee
148
+				? $details['att_obj']
149
+				: null;
150
+
151
+			if (! $attendee instanceof EE_Attendee) {
152
+				continue;
153
+			}
154
+
155
+			// set $aee from attendee object
156
+			$aee['att_obj'] = $attendee;
157
+			$aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs'])
158
+				? $this->_data->attendees[ $attendee->ID() ]['reg_objs']
159
+				: array();
160
+			$aee['attendee_email'] = $attendee->email();
161
+			$aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs'])
162
+				? $this->_data->attendees[ $attendee->ID() ]['tkt_objs']
163
+				: array();
164
+
165
+			if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) {
166
+				$aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
167
+				$aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
168
+			} else {
169
+				$aee['evt_objs'] = $aee['events'] = array();
170
+			}
171
+
172
+			$aee['reg_obj'] = isset($details['reg_obj'])
173
+				? $details['reg_obj']
174
+				: null;
175
+			$aee['attendees'] = $this->_data->attendees;
176
+
177
+			// merge in the primary attendee data
178
+			$aee = array_merge($this->_default_addressee_data, $aee);
179
+
180
+			// make sure txn is set
181
+			if (empty($aee['txn']) && $aee['reg_obj'] instanceof EE_Registration) {
182
+				$aee['txn'] = $aee['reg_obj']->transaction();
183
+			}
184
+
185
+			$addressee[] = new EE_Messages_Addressee($aee);
186
+		}
187
+		return $addressee;
188
+	}
189
+
190
+	/**
191
+	 * Allows a message type to specifically exclude template fields for the provided messenger.
192
+	 * Filtered so this can be programmatically altered as well.
193
+	 *
194
+	 * @param string $messenger_name name of messenger
195
+	 * @return array
196
+	 */
197
+	public function excludedFieldsForMessenger($messenger_name)
198
+	{
199
+		$excluded_fields = array(
200
+			'email' => array('cc')
201
+		);
202
+		return isset($excluded_fields[ $messenger_name ])
203
+			? $excluded_fields[ $messenger_name ]
204
+			: parent::excludedFieldsForMessenger($messenger_name);
205
+	}
206 206
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 
115 115
         foreach ($this->_valid_shortcodes as $context => $shortcodes) {
116 116
             foreach ($shortcodes as $key => $shortcode) {
117
-                if (! in_array($shortcode, $included_shortcodes, true)) {
118
-                    unset($this->_valid_shortcodes[ $context ][ $key ]);
117
+                if ( ! in_array($shortcode, $included_shortcodes, true)) {
118
+                    unset($this->_valid_shortcodes[$context][$key]);
119 119
                 }
120 120
             }
121
-            $this->_valid_shortcodes[ $context ][] = 'newsletter';
121
+            $this->_valid_shortcodes[$context][] = 'newsletter';
122 122
         }
123 123
     }
124 124
 
@@ -148,23 +148,23 @@  discard block
 block discarded – undo
148 148
                 ? $details['att_obj']
149 149
                 : null;
150 150
 
151
-            if (! $attendee instanceof EE_Attendee) {
151
+            if ( ! $attendee instanceof EE_Attendee) {
152 152
                 continue;
153 153
             }
154 154
 
155 155
             // set $aee from attendee object
156 156
             $aee['att_obj'] = $attendee;
157
-            $aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs'])
158
-                ? $this->_data->attendees[ $attendee->ID() ]['reg_objs']
157
+            $aee['reg_objs'] = isset($this->_data->attendees[$attendee->ID()]['reg_objs'])
158
+                ? $this->_data->attendees[$attendee->ID()]['reg_objs']
159 159
                 : array();
160 160
             $aee['attendee_email'] = $attendee->email();
161
-            $aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs'])
162
-                ? $this->_data->attendees[ $attendee->ID() ]['tkt_objs']
161
+            $aee['tkt_objs'] = isset($this->_data->attendees[$attendee->ID()]['tkt_objs'])
162
+                ? $this->_data->attendees[$attendee->ID()]['tkt_objs']
163 163
                 : array();
164 164
 
165
-            if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) {
166
-                $aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
167
-                $aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
165
+            if (isset($this->_data->attendees[$attendee->ID()]['evt_objs'])) {
166
+                $aee['evt_objs'] = $this->_data->attendees[$attendee->ID()]['evt_objs'];
167
+                $aee['events'] = $this->_data->attendees[$attendee->ID()]['evt_objs'];
168 168
             } else {
169 169
                 $aee['evt_objs'] = $aee['events'] = array();
170 170
             }
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
         $excluded_fields = array(
200 200
             'email' => array('cc')
201 201
         );
202
-        return isset($excluded_fields[ $messenger_name ])
203
-            ? $excluded_fields[ $messenger_name ]
202
+        return isset($excluded_fields[$messenger_name])
203
+            ? $excluded_fields[$messenger_name]
204 204
             : parent::excludedFieldsForMessenger($messenger_name);
205 205
     }
206 206
 }
Please login to merge, or discard this patch.
payment_failed/EE_Messages_Email_Payment_Failed_Validator.class.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -16,37 +16,37 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    public function __construct($fields, $context)
20
-    {
21
-        $this->_m_name = 'email';
22
-        $this->_mt_name = 'payment_failed';
23
-
24
-        parent::__construct($fields, $context);
25
-    }
26
-
27
-    /**
28
-     * at this point no custom validation needed for this messenger/message_type combo.
29
-     */
30
-    protected function _modify_validator()
31
-    {
32
-        $new_config = $this->_messenger->get_validator_config();
33
-
34
-        // modify just event_list
35
-        $new_config['event_list'] = array(
36
-            'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
37
-            );
38
-        $new_config['ticket_list'] = array(
39
-            'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
40
-            );
41
-        $new_config['content'] = array(
42
-            'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
43
-            );
44
-        $this->_messenger->set_validator_config($new_config);
45
-
46
-        if ($this->_context != 'admin') {
47
-            $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');
48
-        }
49
-
50
-        $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
51
-    }
19
+	public function __construct($fields, $context)
20
+	{
21
+		$this->_m_name = 'email';
22
+		$this->_mt_name = 'payment_failed';
23
+
24
+		parent::__construct($fields, $context);
25
+	}
26
+
27
+	/**
28
+	 * at this point no custom validation needed for this messenger/message_type combo.
29
+	 */
30
+	protected function _modify_validator()
31
+	{
32
+		$new_config = $this->_messenger->get_validator_config();
33
+
34
+		// modify just event_list
35
+		$new_config['event_list'] = array(
36
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
37
+			);
38
+		$new_config['ticket_list'] = array(
39
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
40
+			);
41
+		$new_config['content'] = array(
42
+			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
43
+			);
44
+		$this->_messenger->set_validator_config($new_config);
45
+
46
+		if ($this->_context != 'admin') {
47
+			$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');
48
+		}
49
+
50
+		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
51
+	}
52 52
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,18 +32,18 @@
 block discarded – undo
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]');
Please login to merge, or discard this patch.