Completed
Branch dependabot/npm_and_yarn/wordpr... (fada19)
by
unknown
19:36 queued 17:22
created
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.
cancelled_registration/EE_Cancelled_Registration_message_type.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@
 block discarded – undo
67 67
 
68 68
         // remove unwanted transaction shortcode
69 69
         foreach ($this->_valid_shortcodes as $context => $shortcodes) {
70
-            if (($key = array_search('transaction', $shortcodes) ) !== false) {
71
-                unset($this->_valid_shortcodes[ $context ][ $key ]);
70
+            if (($key = array_search('transaction', $shortcodes)) !== false) {
71
+                unset($this->_valid_shortcodes[$context][$key]);
72 72
             }
73 73
         }
74 74
     }
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -15,61 +15,61 @@
 block discarded – undo
15 15
 class EE_Cancelled_Registration_message_type extends EE_Registration_Base_message_type
16 16
 {
17 17
 
18
-    public function __construct()
19
-    {
20
-        $this->name = 'cancelled_registration';
21
-        $this->description = esc_html__('This message type is for messages sent to registrants when their registration is cancelled.', 'event_espresso');
22
-        $this->label = array(
23
-            'singular' => esc_html__('registration cancelled', 'event_espresso'),
24
-            'plural' => esc_html__('registrations cancelled', 'event_espresso')
25
-            );
26
-        $this->_master_templates = array(
27
-            'email' => 'not_approved_registration'
28
-            );
29
-        parent::__construct();
30
-    }
18
+	public function __construct()
19
+	{
20
+		$this->name = 'cancelled_registration';
21
+		$this->description = esc_html__('This message type is for messages sent to registrants when their registration is cancelled.', 'event_espresso');
22
+		$this->label = array(
23
+			'singular' => esc_html__('registration cancelled', 'event_espresso'),
24
+			'plural' => esc_html__('registrations cancelled', 'event_espresso')
25
+			);
26
+		$this->_master_templates = array(
27
+			'email' => 'not_approved_registration'
28
+			);
29
+		parent::__construct();
30
+	}
31 31
 
32 32
 
33 33
 
34 34
 
35
-    /**
36
-     * _set_contexts
37
-     * This sets up the contexts associated with the message_type
38
-     *
39
-     * @access  protected
40
-     * @return  void
41
-     */
42
-    protected function _set_contexts()
43
-    {
44
-        $this->_context_label = array(
45
-            'label' => esc_html__('recipient', 'event_espresso'),
46
-            'plural' => esc_html__('recipients', 'event_espresso'),
47
-            'description' => esc_html__('Recipient\'s are who will receive the template.  You may want different registration details sent out depending on who the recipient is', 'event_espresso')
48
-            );
35
+	/**
36
+	 * _set_contexts
37
+	 * This sets up the contexts associated with the message_type
38
+	 *
39
+	 * @access  protected
40
+	 * @return  void
41
+	 */
42
+	protected function _set_contexts()
43
+	{
44
+		$this->_context_label = array(
45
+			'label' => esc_html__('recipient', 'event_espresso'),
46
+			'plural' => esc_html__('recipients', 'event_espresso'),
47
+			'description' => esc_html__('Recipient\'s are who will receive the template.  You may want different registration details sent out depending on who the recipient is', 'event_espresso')
48
+			);
49 49
 
50
-        $this->_contexts = array(
51
-            'admin' => array(
52
-                'label' => esc_html__('Event Admin', 'event_espresso'),
53
-                'description' => esc_html__('This template is what event administrators will receive with an cancelled registration', 'event_espresso')
54
-                ),
55
-            'attendee' => array(
56
-                'label' => esc_html__('Registrant', 'event_espresso'),
57
-                'description' => esc_html__('This template is what each registrant for the event will receive when their registration is cancelled.', 'event_espresso')
58
-                )
59
-            );
60
-    }
50
+		$this->_contexts = array(
51
+			'admin' => array(
52
+				'label' => esc_html__('Event Admin', 'event_espresso'),
53
+				'description' => esc_html__('This template is what event administrators will receive with an cancelled registration', 'event_espresso')
54
+				),
55
+			'attendee' => array(
56
+				'label' => esc_html__('Registrant', 'event_espresso'),
57
+				'description' => esc_html__('This template is what each registrant for the event will receive when their registration is cancelled.', 'event_espresso')
58
+				)
59
+			);
60
+	}
61 61
 
62 62
 
63 63
 
64
-    protected function _set_valid_shortcodes()
65
-    {
66
-        parent::_set_valid_shortcodes();
64
+	protected function _set_valid_shortcodes()
65
+	{
66
+		parent::_set_valid_shortcodes();
67 67
 
68
-        // remove unwanted transaction shortcode
69
-        foreach ($this->_valid_shortcodes as $context => $shortcodes) {
70
-            if (($key = array_search('transaction', $shortcodes) ) !== false) {
71
-                unset($this->_valid_shortcodes[ $context ][ $key ]);
72
-            }
73
-        }
74
-    }
68
+		// remove unwanted transaction shortcode
69
+		foreach ($this->_valid_shortcodes as $context => $shortcodes) {
70
+			if (($key = array_search('transaction', $shortcodes) ) !== false) {
71
+				unset($this->_valid_shortcodes[ $context ][ $key ]);
72
+			}
73
+		}
74
+	}
75 75
 }
Please login to merge, or discard this patch.
EE_Messages_Email_Cancelled_Registration_Validator.class.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,30 +15,30 @@
 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 = 'cancelled_registration';
18
+	public function __construct($fields, $context)
19
+	{
20
+		$this->_m_name = 'email';
21
+		$this->_mt_name = 'cancelled_registration';
22 22
 
23
-        parent::__construct($fields, $context);
24
-    }
23
+		parent::__construct($fields, $context);
24
+	}
25 25
 
26
-    /**
27
-     * custom validator (will override what was originally set by the message_type and 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 (will override what was originally set by the message_type and 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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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]');
Please login to merge, or discard this patch.
payment_cancelled/EE_Messages_Email_Payment_Cancelled_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_cancelled';
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_cancelled';
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.
EE_Messages_Email_Declined_Registration_Validator.class.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -15,31 +15,31 @@
 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 = 'declined_registration';
18
+	public function __construct($fields, $context)
19
+	{
20
+		$this->_m_name = 'email';
21
+		$this->_mt_name = 'declined_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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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]');
Please login to merge, or discard this patch.
payment_reminder/EE_Messages_Email_Payment_Reminder_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_reminder';
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_reminder';
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.
caffeinated/core/libraries/shortcodes/EE_Question_Shortcodes.lib.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     protected function _parser($shortcode)
50 50
     {
51 51
 
52
-        if (! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
52
+        if ( ! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
53 53
             return '';
54 54
         }
55 55
 
56 56
         switch ($shortcode) {
57 57
             case '[QUESTION]':
58
-                $question = isset($this->_extra_data['data']->questions[ $this->_data->ID() ])
59
-                    ? $this->_extra_data['data']->questions[ $this->_data->ID() ] : $this->_data->question();
60
-                if (! $question instanceof EE_Question) {
58
+                $question = isset($this->_extra_data['data']->questions[$this->_data->ID()])
59
+                    ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question();
60
+                if ( ! $question instanceof EE_Question) {
61 61
                     return ''; // get out because we can't figure out what the question is.
62 62
                 }
63 63
 
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 
67 67
             case '[ANSWER]':
68 68
                 // need to get the question to determine the type of question (some questions require translation of the answer).
69
-                $question = isset($this->_extra_data['data']->questions[ $this->_data->ID() ])
70
-                    ? $this->_extra_data['data']->questions[ $this->_data->ID() ] : $this->_data->question();
71
-                if (! $question instanceof EE_Question) {
69
+                $question = isset($this->_extra_data['data']->questions[$this->_data->ID()])
70
+                    ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question();
71
+                if ( ! $question instanceof EE_Question) {
72 72
                     return ''; // get out cause we can't figure out what the question type is!
73 73
                 }
74 74
 
Please login to merge, or discard this patch.
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -19,85 +19,85 @@
 block discarded – undo
19 19
 {
20 20
 
21 21
 
22
-    /**
23
-     * _init_props
24
-     *
25
-     * @access protected
26
-     * @return void
27
-     */
28
-    protected function _init_props()
29
-    {
30
-        $this->label = esc_html__('Attendee Shortcodes', 'event_espresso');
31
-        $this->description = esc_html__('All shortcodes specific to attendee related data', 'event_espresso');
32
-        $this->_shortcodes = array(
33
-            '[QUESTION]' => esc_html__('Will parse to a question.', 'event_espresso'),
34
-            '[ANSWER]'   => esc_html__('Will parse to the answer for a question', 'event_espresso'),
35
-        );
36
-    }
22
+	/**
23
+	 * _init_props
24
+	 *
25
+	 * @access protected
26
+	 * @return void
27
+	 */
28
+	protected function _init_props()
29
+	{
30
+		$this->label = esc_html__('Attendee Shortcodes', 'event_espresso');
31
+		$this->description = esc_html__('All shortcodes specific to attendee related data', 'event_espresso');
32
+		$this->_shortcodes = array(
33
+			'[QUESTION]' => esc_html__('Will parse to a question.', 'event_espresso'),
34
+			'[ANSWER]'   => esc_html__('Will parse to the answer for a question', 'event_espresso'),
35
+		);
36
+	}
37 37
 
38 38
 
39
-    /**
40
-     * This method will give parsing instructions for each shortcode defined in the _shortcodes array.  Child methods
41
-     * will have to take care of handling.
42
-     *
43
-     * @access protected
44
-     *
45
-     * @param string $shortcode the shortcode to be parsed.
46
-     *
47
-     * @return string parsed shortcode
48
-     */
49
-    protected function _parser($shortcode)
50
-    {
39
+	/**
40
+	 * This method will give parsing instructions for each shortcode defined in the _shortcodes array.  Child methods
41
+	 * will have to take care of handling.
42
+	 *
43
+	 * @access protected
44
+	 *
45
+	 * @param string $shortcode the shortcode to be parsed.
46
+	 *
47
+	 * @return string parsed shortcode
48
+	 */
49
+	protected function _parser($shortcode)
50
+	{
51 51
 
52
-        if (! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
53
-            return '';
54
-        }
52
+		if (! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
53
+			return '';
54
+		}
55 55
 
56
-        switch ($shortcode) {
57
-            case '[QUESTION]':
58
-                $question = isset($this->_extra_data['data']->questions[ $this->_data->ID() ])
59
-                    ? $this->_extra_data['data']->questions[ $this->_data->ID() ] : $this->_data->question();
60
-                if (! $question instanceof EE_Question) {
61
-                    return ''; // get out because we can't figure out what the question is.
62
-                }
56
+		switch ($shortcode) {
57
+			case '[QUESTION]':
58
+				$question = isset($this->_extra_data['data']->questions[ $this->_data->ID() ])
59
+					? $this->_extra_data['data']->questions[ $this->_data->ID() ] : $this->_data->question();
60
+				if (! $question instanceof EE_Question) {
61
+					return ''; // get out because we can't figure out what the question is.
62
+				}
63 63
 
64
-                return $question->get('QST_display_text');
65
-                break;
64
+				return $question->get('QST_display_text');
65
+				break;
66 66
 
67
-            case '[ANSWER]':
68
-                // need to get the question to determine the type of question (some questions require translation of the answer).
69
-                $question = isset($this->_extra_data['data']->questions[ $this->_data->ID() ])
70
-                    ? $this->_extra_data['data']->questions[ $this->_data->ID() ] : $this->_data->question();
71
-                if (! $question instanceof EE_Question) {
72
-                    return ''; // get out cause we can't figure out what the question type is!
73
-                }
67
+			case '[ANSWER]':
68
+				// need to get the question to determine the type of question (some questions require translation of the answer).
69
+				$question = isset($this->_extra_data['data']->questions[ $this->_data->ID() ])
70
+					? $this->_extra_data['data']->questions[ $this->_data->ID() ] : $this->_data->question();
71
+				if (! $question instanceof EE_Question) {
72
+					return ''; // get out cause we can't figure out what the question type is!
73
+				}
74 74
 
75
-                // what we show for the answer depends on the question type!
76
-                switch ($question->get('QST_type')) {
77
-                    case 'STATE':
78
-                        $state = EEM_State::instance()->get_one_by_ID($this->_data->get('ANS_value'));
79
-                        $answer = $state instanceof EE_State ? $state->name() : '';
80
-                        break;
75
+				// what we show for the answer depends on the question type!
76
+				switch ($question->get('QST_type')) {
77
+					case 'STATE':
78
+						$state = EEM_State::instance()->get_one_by_ID($this->_data->get('ANS_value'));
79
+						$answer = $state instanceof EE_State ? $state->name() : '';
80
+						break;
81 81
 
82
-                    case 'COUNTRY':
83
-                        $country = EEM_Country::instance()->get_one_by_ID($this->_data->get('ANS_value'));
84
-                        $answer = $country instanceof EE_Country ? $country->name() : '';
85
-                        break;
82
+					case 'COUNTRY':
83
+						$country = EEM_Country::instance()->get_one_by_ID($this->_data->get('ANS_value'));
84
+						$answer = $country instanceof EE_Country ? $country->name() : '';
85
+						break;
86 86
 
87
-                    default:
88
-                        $answer = $this->_data->get_pretty('ANS_value', 'no_wpautop');
89
-                        break;
90
-                }
87
+					default:
88
+						$answer = $this->_data->get_pretty('ANS_value', 'no_wpautop');
89
+						break;
90
+				}
91 91
 
92
-                return apply_filters(
93
-                    'FHEE__EE_Question_Shortcodes___parser__answer',
94
-                    $answer,
95
-                    $question,
96
-                    $this->_data
97
-                );
98
-                break;
99
-        }
92
+				return apply_filters(
93
+					'FHEE__EE_Question_Shortcodes___parser__answer',
94
+					$answer,
95
+					$question,
96
+					$this->_data
97
+				);
98
+				break;
99
+		}
100 100
 
101
-        return '';
102
-    }
101
+		return '';
102
+	}
103 103
 }
Please login to merge, or discard this patch.