Completed
Branch dev (1399ad)
by
unknown
60:04 queued 50:49
created
messages/validators/html/EE_Messages_Html_Receipt_Validator.class.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@
 block discarded – undo
16 16
 class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator
17 17
 {
18 18
 
19
-    public function __construct($fields, $context)
20
-    {
21
-        $this->_m_name = 'html';
22
-        $this->_mt_name = 'receipt';
19
+	public function __construct($fields, $context)
20
+	{
21
+		$this->_m_name = 'html';
22
+		$this->_mt_name = 'receipt';
23 23
 
24
-        parent::__construct($fields, $context);
25
-    }
24
+		parent::__construct($fields, $context);
25
+	}
26 26
 
27
-    /**
28
-     * custom validator (restricting what was originally set by the messenger).
29
-     * Note nothing is currently done for this messenger and message type.
30
-     */
31
-    protected function _modify_validator()
32
-    {
33
-        $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]');
34
-        return;
35
-    }
27
+	/**
28
+	 * custom validator (restricting what was originally set by the messenger).
29
+	 * Note nothing is currently done for this messenger and message type.
30
+	 */
31
+	protected function _modify_validator()
32
+	{
33
+		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_HTML_URL]');
34
+		return;
35
+	}
36 36
 }
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messenger_Collection.lib.php 2 patches
Indentation   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -14,183 +14,183 @@
 block discarded – undo
14 14
 class EE_Messenger_Collection extends EE_Object_Collection
15 15
 {
16 16
 
17
-    /**
18
-     * EE_Messenger_Collection constructor.
19
-     */
20
-    public function __construct()
21
-    {
22
-        $this->interface = 'EE_messenger';
23
-    }
24
-
25
-
26
-
27
-    /**
28
-     * add
29
-     *
30
-     * attaches an object to the Collection
31
-     * and sets any supplied data associated with the current iterator entry
32
-     * by calling EE_Object_Collection::set_info()
33
-     *
34
-     * @access public
35
-     * @param object $object
36
-     * @param mixed  $info
37
-     * @return bool
38
-     */
39
-    public function add($object, $info = null)
40
-    {
41
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
42
-        return parent::add($object, $info);
43
-    }
44
-
45
-
46
-
47
-    /**
48
-     * set_info
49
-     *
50
-     * Sets the data associated with an object in the Collection
51
-     * if no $info is supplied, then the spl_object_hash() is used
52
-     *
53
-     * @access public
54
-     * @param object $object
55
-     * @param mixed  $info
56
-     * @return bool
57
-     */
58
-    public function set_info($object, $info = null)
59
-    {
60
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
61
-        return parent::set_info($object, $info);
62
-    }
63
-
64
-
65
-
66
-    /**
67
-     * get_by_info
68
-     *
69
-     * finds and returns an object in the Collection based on the info that was set using addObject()
70
-     * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
71
-     *
72
-     * @access public
73
-     * @param mixed
74
-     * @return null | object
75
-     */
76
-    public function get_by_info($info)
77
-    {
78
-        return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
79
-    }
80
-
81
-
82
-
83
-    /**
84
-     * has
85
-     *
86
-     * returns TRUE or FALSE depending on whether the supplied object is within the Collection
87
-     *
88
-     * @access public
89
-     * @param object $object
90
-     * @return bool
91
-     */
92
-    public function has($object)
93
-    {
94
-        return parent::has($object);
95
-    }
96
-
97
-
98
-
99
-    /**
100
-     * has_by_name
101
-     *
102
-     * returns TRUE or FALSE depending on whether the supplied messenger name is within the Collection
103
-     *
104
-     * @access public
105
-     * @param string $messenger_name
106
-     * @return bool
107
-     */
108
-    public function has_by_name($messenger_name)
109
-    {
110
-        return $this->get_by_info($messenger_name) instanceof $this->interface ? true : false;
111
-    }
112
-
113
-
114
-
115
-    /**
116
-     * remove
117
-     *
118
-     * detaches an object from the Collection
119
-     *
120
-     * @access public
121
-     * @param $object
122
-     * @return bool
123
-     */
124
-    public function remove($object)
125
-    {
126
-        return parent::remove($object);
127
-    }
128
-
129
-
130
-
131
-    /**
132
-     * current
133
-     *
134
-     * current object from the Collection
135
-     *
136
-     * @access public
137
-     * @return EE_messenger
138
-     */
139
-    public function current()
140
-    {
141
-        return parent::current();
142
-    }
143
-
144
-
145
-
146
-    /**
147
-     * set_current
148
-     *
149
-     * advances pointer to the provided object
150
-     *
151
-     * @access public
152
-     * @param $object
153
-     * @return void
154
-     */
155
-    public function set_current($object)
156
-    {
157
-        parent::set_current($object);
158
-    }
159
-
160
-
161
-
162
-    /**
163
-     * set_current_by_info
164
-     *
165
-     * advances pointer to the object whose info matches that which was provided
166
-     *
167
-     * @access public
168
-     * @param $info
169
-     * @return void
170
-     */
171
-    public function set_current_by_info($info)
172
-    {
173
-        parent::set_current_by_info($info);
174
-    }
175
-
176
-
177
-
178
-    /**
179
-     * show_collection_classes
180
-     *
181
-     * displays list of collection classes if WP_DEBUG is on
182
-     *
183
-     * @access public
184
-     * @return void
185
-     */
186
-    public function show_collection_classes()
187
-    {
188
-        if (WP_DEBUG) {
189
-            $this->rewind();
190
-            while ($this->valid()) {
191
-                echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : . <span style="color:#E76700">' . $this->getInfo() . '</span></h5>';
192
-                $this->next();
193
-            }
194
-        }
195
-    }
17
+	/**
18
+	 * EE_Messenger_Collection constructor.
19
+	 */
20
+	public function __construct()
21
+	{
22
+		$this->interface = 'EE_messenger';
23
+	}
24
+
25
+
26
+
27
+	/**
28
+	 * add
29
+	 *
30
+	 * attaches an object to the Collection
31
+	 * and sets any supplied data associated with the current iterator entry
32
+	 * by calling EE_Object_Collection::set_info()
33
+	 *
34
+	 * @access public
35
+	 * @param object $object
36
+	 * @param mixed  $info
37
+	 * @return bool
38
+	 */
39
+	public function add($object, $info = null)
40
+	{
41
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
42
+		return parent::add($object, $info);
43
+	}
44
+
45
+
46
+
47
+	/**
48
+	 * set_info
49
+	 *
50
+	 * Sets the data associated with an object in the Collection
51
+	 * if no $info is supplied, then the spl_object_hash() is used
52
+	 *
53
+	 * @access public
54
+	 * @param object $object
55
+	 * @param mixed  $info
56
+	 * @return bool
57
+	 */
58
+	public function set_info($object, $info = null)
59
+	{
60
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
61
+		return parent::set_info($object, $info);
62
+	}
63
+
64
+
65
+
66
+	/**
67
+	 * get_by_info
68
+	 *
69
+	 * finds and returns an object in the Collection based on the info that was set using addObject()
70
+	 * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
71
+	 *
72
+	 * @access public
73
+	 * @param mixed
74
+	 * @return null | object
75
+	 */
76
+	public function get_by_info($info)
77
+	{
78
+		return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
79
+	}
80
+
81
+
82
+
83
+	/**
84
+	 * has
85
+	 *
86
+	 * returns TRUE or FALSE depending on whether the supplied object is within the Collection
87
+	 *
88
+	 * @access public
89
+	 * @param object $object
90
+	 * @return bool
91
+	 */
92
+	public function has($object)
93
+	{
94
+		return parent::has($object);
95
+	}
96
+
97
+
98
+
99
+	/**
100
+	 * has_by_name
101
+	 *
102
+	 * returns TRUE or FALSE depending on whether the supplied messenger name is within the Collection
103
+	 *
104
+	 * @access public
105
+	 * @param string $messenger_name
106
+	 * @return bool
107
+	 */
108
+	public function has_by_name($messenger_name)
109
+	{
110
+		return $this->get_by_info($messenger_name) instanceof $this->interface ? true : false;
111
+	}
112
+
113
+
114
+
115
+	/**
116
+	 * remove
117
+	 *
118
+	 * detaches an object from the Collection
119
+	 *
120
+	 * @access public
121
+	 * @param $object
122
+	 * @return bool
123
+	 */
124
+	public function remove($object)
125
+	{
126
+		return parent::remove($object);
127
+	}
128
+
129
+
130
+
131
+	/**
132
+	 * current
133
+	 *
134
+	 * current object from the Collection
135
+	 *
136
+	 * @access public
137
+	 * @return EE_messenger
138
+	 */
139
+	public function current()
140
+	{
141
+		return parent::current();
142
+	}
143
+
144
+
145
+
146
+	/**
147
+	 * set_current
148
+	 *
149
+	 * advances pointer to the provided object
150
+	 *
151
+	 * @access public
152
+	 * @param $object
153
+	 * @return void
154
+	 */
155
+	public function set_current($object)
156
+	{
157
+		parent::set_current($object);
158
+	}
159
+
160
+
161
+
162
+	/**
163
+	 * set_current_by_info
164
+	 *
165
+	 * advances pointer to the object whose info matches that which was provided
166
+	 *
167
+	 * @access public
168
+	 * @param $info
169
+	 * @return void
170
+	 */
171
+	public function set_current_by_info($info)
172
+	{
173
+		parent::set_current_by_info($info);
174
+	}
175
+
176
+
177
+
178
+	/**
179
+	 * show_collection_classes
180
+	 *
181
+	 * displays list of collection classes if WP_DEBUG is on
182
+	 *
183
+	 * @access public
184
+	 * @return void
185
+	 */
186
+	public function show_collection_classes()
187
+	{
188
+		if (WP_DEBUG) {
189
+			$this->rewind();
190
+			while ($this->valid()) {
191
+				echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : . <span style="color:#E76700">' . $this->getInfo() . '</span></h5>';
192
+				$this->next();
193
+			}
194
+		}
195
+	}
196 196
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@
 block discarded – undo
188 188
         if (WP_DEBUG) {
189 189
             $this->rewind();
190 190
             while ($this->valid()) {
191
-                echo '<h5 style="color:#2EA2CC;">' . __CLASS__ . ' class : . <span style="color:#E76700">' . $this->getInfo() . '</span></h5>';
191
+                echo '<h5 style="color:#2EA2CC;">'.__CLASS__.' class : . <span style="color:#E76700">'.$this->getInfo().'</span></h5>';
192 192
                 $this->next();
193 193
             }
194 194
         }
Please login to merge, or discard this patch.
core/libraries/messages/messenger/EE_Html_messenger.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                     ),
314 314
                     'ticket_line_item_no_pms' => array(
315 315
                         'input' => 'textarea',
316
-                        'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __(
316
+                        'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__(
317 317
                             'Ticket Line Item List with no Price Modifiers',
318 318
                             'event_espresso'
319 319
                         ),
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                     ),
328 328
                     'ticket_line_item_pms' => array(
329 329
                         'input' => 'textarea',
330
-                        'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __(
330
+                        'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__(
331 331
                             'Ticket Line Item List with Price Modifiers',
332 332
                             'event_espresso'
333 333
                         ),
Please login to merge, or discard this patch.
Indentation   +545 added lines, -545 removed lines patch added patch discarded remove patch
@@ -12,549 +12,549 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    /**
16
-     * The following are the properties that this messenger requires for displaying the html
17
-     */
18
-    /**
19
-     * This is the html body generated by the template via the message type.
20
-     *
21
-     * @var string
22
-     */
23
-    protected $_content;
24
-
25
-
26
-    /**
27
-     * This is for the page title that gets displayed.  (Why use "subject"?  Because the "title" tag in html is
28
-     * equivalent to the "subject" of the page.
29
-     *
30
-     * @var string
31
-     */
32
-    protected $_subject;
33
-
34
-
35
-    /**
36
-     * EE_Html_messenger constructor.
37
-     */
38
-    public function __construct()
39
-    {
40
-        // set properties
41
-        $this->name = 'html';
42
-        $this->description = __('This messenger outputs a message to a browser for display.', 'event_espresso');
43
-        $this->label = array(
44
-            'singular' => __('html', 'event_espresso'),
45
-            'plural' => __('html', 'event_espresso'),
46
-        );
47
-        $this->activate_on_install = true;
48
-        // add the "powered by EE" credit link to the HTML receipt and invoice
49
-        add_filter(
50
-            'FHEE__EE_Html_messenger___send_message__main_body',
51
-            array($this, 'add_powered_by_credit_link_to_receipt_and_invoice'),
52
-            10,
53
-            3
54
-        );
55
-        parent::__construct();
56
-    }
57
-
58
-
59
-    /**
60
-     * HTML Messenger desires execution immediately.
61
-     *
62
-     * @see    parent::send_now() for documentation.
63
-     * @since  4.9.0
64
-     * @return bool
65
-     */
66
-    public function send_now()
67
-    {
68
-        return true;
69
-    }
70
-
71
-
72
-    /**
73
-     * HTML Messenger allows an empty to field.
74
-     *
75
-     * @see    parent::allow_empty_to_field() for documentation
76
-     * @since  4.9.0
77
-     * @return bool
78
-     */
79
-    public function allow_empty_to_field()
80
-    {
81
-        return true;
82
-    }
83
-
84
-
85
-    /**
86
-     * @see abstract declaration in EE_messenger for details.
87
-     */
88
-    protected function _set_admin_pages()
89
-    {
90
-        $this->admin_registered_pages = array('events_edit' => true);
91
-    }
92
-
93
-
94
-    /**
95
-     * @see abstract declaration in EE_messenger for details.
96
-     */
97
-    protected function _set_valid_shortcodes()
98
-    {
99
-        $this->_valid_shortcodes = array();
100
-    }
101
-
102
-
103
-    /**
104
-     * @see abstract declaration in EE_messenger for details.
105
-     */
106
-    protected function _set_validator_config()
107
-    {
108
-        $this->_validator_config = array(
109
-            'subject' => array(
110
-                'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction'),
111
-            ),
112
-            'content' => array(
113
-                'shortcodes' => array(
114
-                    'organization',
115
-                    'primary_registration_list',
116
-                    'primary_registration_details',
117
-                    'email',
118
-                    'transaction',
119
-                    'event_list',
120
-                    'payment_list',
121
-                    'venue',
122
-                    'line_item_list',
123
-                    'messenger',
124
-                    'ticket_list',
125
-                ),
126
-            ),
127
-            'event_list' => array(
128
-                'shortcodes' => array(
129
-                    'event',
130
-                    'ticket_list',
131
-                    'venue',
132
-                    'primary_registration_details',
133
-                    'primary_registration_list',
134
-                    'event_author',
135
-                ),
136
-                'required' => array('[EVENT_LIST]'),
137
-            ),
138
-            'ticket_list' => array(
139
-                'shortcodes' => array(
140
-                    'attendee_list',
141
-                    'ticket',
142
-                    'datetime_list',
143
-                    'primary_registration_details',
144
-                    'line_item_list',
145
-                    'venue',
146
-                ),
147
-                'required' => array('[TICKET_LIST]'),
148
-            ),
149
-            'ticket_line_item_no_pms' => array(
150
-                'shortcodes' => array('line_item', 'ticket'),
151
-                'required' => array('[TICKET_LINE_ITEM_LIST]'),
152
-            ),
153
-            'ticket_line_item_pms' => array(
154
-                'shortcodes' => array('line_item', 'ticket', 'line_item_list'),
155
-                'required' => array('[TICKET_LINE_ITEM_LIST]'),
156
-            ),
157
-            'price_modifier_line_item_list' => array(
158
-                'shortcodes' => array('line_item'),
159
-                'required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]'),
160
-            ),
161
-            'datetime_list' => array(
162
-                'shortcodes' => array('datetime'),
163
-                'required' => array('[DATETIME_LIST]'),
164
-            ),
165
-            'attendee_list' => array(
166
-                'shortcodes' => array('attendee'),
167
-                'required' => array('[ATTENDEE_LIST]'),
168
-            ),
169
-            'tax_line_item_list' => array(
170
-                'shortcodes' => array('line_item'),
171
-                'required' => array('[TAX_LINE_ITEM_LIST]'),
172
-            ),
173
-            'additional_line_item_list' => array(
174
-                'shortcodes' => array('line_item'),
175
-                'required' => array('[ADDITIONAL_LINE_ITEM_LIST]'),
176
-            ),
177
-            'payment_list' => array(
178
-                'shortcodes' => array('payment'),
179
-                'required' => array('[PAYMENT_LIST_*]'),
180
-            ),
181
-        );
182
-    }
183
-
184
-
185
-    /**
186
-     * This is a method called from EE_messages when this messenger is a generating messenger and the sending messenger
187
-     * is a different messenger.  Child messengers can set hooks for the sending messenger to callback on if necessary
188
-     * (i.e. swap out css files or something else).
189
-     *
190
-     * @since 4.5.0
191
-     * @param string $sending_messenger_name the name of the sending messenger so we only set the hooks needed.
192
-     * @return void
193
-     */
194
-    public function do_secondary_messenger_hooks($sending_messenger_name)
195
-    {
196
-        if ($sending_messenger_name === 'pdf') {
197
-            add_filter('EE_messenger__get_variation__variation', array($this, 'add_html_css'), 10, 8);
198
-        }
199
-    }
200
-
201
-
202
-    /**
203
-     * @param                            $variation_path
204
-     * @param \EE_Messages_Template_Pack $template_pack
205
-     * @param                            $messenger_name
206
-     * @param                            $message_type_name
207
-     * @param                            $url
208
-     * @param                            $type
209
-     * @param                            $variation
210
-     * @param                            $skip_filters
211
-     * @return string
212
-     */
213
-    public function add_html_css(
214
-        $variation_path,
215
-        EE_Messages_Template_Pack $template_pack,
216
-        $messenger_name,
217
-        $message_type_name,
218
-        $url,
219
-        $type,
220
-        $variation,
221
-        $skip_filters
222
-    ) {
223
-        $variation = $template_pack->get_variation(
224
-            $this->name,
225
-            $message_type_name,
226
-            $type,
227
-            $variation,
228
-            $url,
229
-            '.css',
230
-            $skip_filters
231
-        );
232
-        return $variation;
233
-    }
234
-
235
-
236
-    /**
237
-     * Takes care of enqueuing any necessary scripts or styles for the page.  A do_action() so message types using this
238
-     * messenger can add their own js.
239
-     *
240
-     * @return void.
241
-     */
242
-    public function enqueue_scripts_styles()
243
-    {
244
-        parent::enqueue_scripts_styles();
245
-        do_action('AHEE__EE_Html_messenger__enqueue_scripts_styles');
246
-    }
247
-
248
-
249
-    /**
250
-     * _set_template_fields
251
-     * This sets up the fields that a messenger requires for the message to go out.
252
-     *
253
-     * @access  protected
254
-     * @return void
255
-     */
256
-    protected function _set_template_fields()
257
-    {
258
-        // any extra template fields that are NOT used by the messenger
259
-        // but will get used by a messenger field for shortcode replacement
260
-        // get added to the 'extra' key in an associated array
261
-        // indexed by the messenger field they relate to.
262
-        // This is important for the Messages_admin to know what fields to display to the user.
263
-        // Also, notice that the "values" are equal to the field type
264
-        // that messages admin will use to know what kind of field to display.
265
-        // The values ALSO have one index labeled "shortcode".
266
-        // The values in that array indicate which ACTUAL SHORTCODE (i.e. [SHORTCODE])
267
-        // is required in order for this extra field to be displayed.
268
-        //  If the required shortcode isn't part of the shortcodes array
269
-        // then the field is not needed and will not be displayed/parsed.
270
-        $this->_template_fields = array(
271
-            'subject' => array(
272
-                'input' => 'text',
273
-                'label' => __('Page Title', 'event_espresso'),
274
-                'type' => 'string',
275
-                'required' => true,
276
-                'validation' => true,
277
-                'css_class' => 'large-text',
278
-                'format' => '%s',
279
-            ),
280
-            'content' => '',
281
-            // left empty b/c it is in the "extra array" but messenger still needs needs to know this is a field.
282
-            'extra' => array(
283
-                'content' => array(
284
-                    'main' => array(
285
-                        'input' => 'wp_editor',
286
-                        'label' => __('Main Content', 'event_espresso'),
287
-                        'type' => 'string',
288
-                        'required' => true,
289
-                        'validation' => true,
290
-                        'format' => '%s',
291
-                        'rows' => '15',
292
-                    ),
293
-                    'event_list' => array(
294
-                        'input' => 'wp_editor',
295
-                        'label' => '[EVENT_LIST]',
296
-                        'type' => 'string',
297
-                        'required' => true,
298
-                        'validation' => true,
299
-                        'format' => '%s',
300
-                        'rows' => '15',
301
-                        'shortcodes_required' => array('[EVENT_LIST]'),
302
-                    ),
303
-                    'ticket_list' => array(
304
-                        'input' => 'textarea',
305
-                        'label' => '[TICKET_LIST]',
306
-                        'type' => 'string',
307
-                        'required' => true,
308
-                        'validation' => true,
309
-                        'format' => '%s',
310
-                        'css_class' => 'large-text',
311
-                        'rows' => '10',
312
-                        'shortcodes_required' => array('[TICKET_LIST]'),
313
-                    ),
314
-                    'ticket_line_item_no_pms' => array(
315
-                        'input' => 'textarea',
316
-                        'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __(
317
-                            'Ticket Line Item List with no Price Modifiers',
318
-                            'event_espresso'
319
-                        ),
320
-                        'type' => 'string',
321
-                        'required' => false,
322
-                        'validation' => true,
323
-                        'format' => '%s',
324
-                        'css_class' => 'large-text',
325
-                        'rows' => '5',
326
-                        'shortcodes_required' => array('[TICKET_LINE_ITEM_LIST]'),
327
-                    ),
328
-                    'ticket_line_item_pms' => array(
329
-                        'input' => 'textarea',
330
-                        'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __(
331
-                            'Ticket Line Item List with Price Modifiers',
332
-                            'event_espresso'
333
-                        ),
334
-                        'type' => 'string',
335
-                        'required' => false,
336
-                        'validation' => true,
337
-                        'format' => '%s',
338
-                        'css_class' => 'large-text',
339
-                        'rows' => '5',
340
-                        'shortcodes_required' => array('[TICKET_LINE_ITEM_LIST]'),
341
-                    ),
342
-                    'price_modifier_line_item_list' => array(
343
-                        'input' => 'textarea',
344
-                        'label' => '[PRICE_MODIFIER_LINE_ITEM_LIST]',
345
-                        'type' => 'string',
346
-                        'required' => false,
347
-                        'validation' => true,
348
-                        'format' => '%s',
349
-                        'css_class' => 'large-text',
350
-                        'rows' => '5',
351
-                        'shortcodes_required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]'),
352
-                    ),
353
-                    'datetime_list' => array(
354
-                        'input' => 'textarea',
355
-                        'label' => '[DATETIME_LIST]',
356
-                        'type' => 'string',
357
-                        'required' => true,
358
-                        'validation' => true,
359
-                        'format' => '%s',
360
-                        'css_class' => 'large-text',
361
-                        'rows' => '5',
362
-                        'shortcodes_required' => array('[DATETIME_LIST]'),
363
-                    ),
364
-                    'attendee_list' => array(
365
-                        'input' => 'textarea',
366
-                        'label' => '[ATTENDEE_LIST]',
367
-                        'type' => 'string',
368
-                        'required' => true,
369
-                        'validation' => true,
370
-                        'format' => '%s',
371
-                        'css_class' => 'large-text',
372
-                        'rows' => '5',
373
-                        'shortcodes_required' => array('[ATTENDEE_LIST]'),
374
-                    ),
375
-                    'tax_line_item_list' => array(
376
-                        'input' => 'textarea',
377
-                        'label' => '[TAX_LINE_ITEM_LIST]',
378
-                        'type' => 'string',
379
-                        'required' => false,
380
-                        'validation' => true,
381
-                        'format' => '%s',
382
-                        'css_class' => 'large-text',
383
-                        'rows' => '5',
384
-                        'shortcodes_required' => array('[TAX_LINE_ITEM_LIST]'),
385
-                    ),
386
-                    'additional_line_item_list' => array(
387
-                        'input' => 'textarea',
388
-                        'label' => '[ADDITIONAL_LINE_ITEM_LIST]',
389
-                        'type' => 'string',
390
-                        'required' => false,
391
-                        'validation' => true,
392
-                        'format' => '%s',
393
-                        'css_class' => 'large-text',
394
-                        'rows' => '5',
395
-                        'shortcodes_required' => array('[ADDITIONAL_LINE_ITEM_LIST]'),
396
-                    ),
397
-                    'payment_list' => array(
398
-                        'input' => 'textarea',
399
-                        'label' => '[PAYMENT_LIST]',
400
-                        'type' => 'string',
401
-                        'required' => true,
402
-                        'validation' => true,
403
-                        'format' => '%s',
404
-                        'css_class' => 'large-text',
405
-                        'rows' => '5',
406
-                        'shortcodes_required' => array('[PAYMENT_LIST_*]'),
407
-                    ),
408
-                ),
409
-            ),
410
-        );
411
-    }
412
-
413
-
414
-    /**
415
-     * @see   definition of this method in parent
416
-     * @since 4.5.0
417
-     */
418
-    protected function _set_default_message_types()
419
-    {
420
-        $this->_default_message_types = array('receipt', 'invoice');
421
-    }
422
-
423
-
424
-    /**
425
-     * @see   definition of this method in parent
426
-     * @since 4.5.0
427
-     */
428
-    protected function _set_valid_message_types()
429
-    {
430
-        $this->_valid_message_types = array('receipt', 'invoice');
431
-    }
432
-
433
-
434
-    /**
435
-     * Displays the message in the browser.
436
-     *
437
-     * @since 4.5.0
438
-     * @return string.
439
-     */
440
-    protected function _send_message()
441
-    {
442
-        $this->_template_args = array(
443
-            'page_title' => $this->_subject,
444
-            'base_css' => $this->get_variation(
445
-                $this->_tmp_pack,
446
-                $this->_incoming_message_type->name,
447
-                true,
448
-                'base',
449
-                $this->_variation
450
-            ),
451
-            'print_css' => $this->get_variation(
452
-                $this->_tmp_pack,
453
-                $this->_incoming_message_type->name,
454
-                true,
455
-                'print',
456
-                $this->_variation
457
-            ),
458
-            'main_css' => $this->get_variation(
459
-                $this->_tmp_pack,
460
-                $this->_incoming_message_type->name,
461
-                true,
462
-                'main',
463
-                $this->_variation
464
-            ),
465
-            'main_body' => wpautop(
466
-                apply_filters(
467
-                    'FHEE__EE_Html_messenger___send_message__main_body',
468
-                    $this->_content,
469
-                    $this->_content,
470
-                    $this->_incoming_message_type
471
-                )
472
-            )
473
-        );
474
-        $this->_deregister_wp_hooks();
475
-        add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles'));
476
-        echo $this->_get_main_template();
477
-        exit();
478
-    }
479
-
480
-
481
-    /**
482
-     * The purpose of this function is to de register all actions hooked into wp_head and wp_footer so that it doesn't
483
-     * interfere with our templates.  If users want to add any custom styles or scripts they must use the
484
-     * AHEE__EE_Html_messenger__enqueue_scripts_styles hook.
485
-     *
486
-     * @since 4.5.0
487
-     * @return void
488
-     */
489
-    protected function _deregister_wp_hooks()
490
-    {
491
-        remove_all_actions('wp_head');
492
-        remove_all_actions('wp_footer');
493
-        remove_all_actions('wp_print_footer_scripts');
494
-        remove_all_actions('wp_enqueue_scripts');
495
-        global $wp_scripts, $wp_styles;
496
-        $wp_scripts = $wp_styles = array();
497
-        // just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load.
498
-        add_action('wp_footer', 'wp_print_footer_scripts');
499
-        add_action('wp_print_footer_scripts', '_wp_footer_scripts');
500
-        add_action('wp_head', 'wp_enqueue_scripts');
501
-    }
502
-
503
-
504
-    /**
505
-     * Overwrite parent _get_main_template for display_html purposes.
506
-     *
507
-     * @since  4.5.0
508
-     * @param bool $preview
509
-     * @return string
510
-     */
511
-    protected function _get_main_template($preview = false)
512
-    {
513
-        $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, 'main');
514
-        // include message type as a template arg
515
-        $this->_template_args['message_type'] = $this->_incoming_message_type;
516
-        return EEH_Template::display_template($wrapper_template, $this->_template_args, true);
517
-    }
518
-
519
-
520
-    /**
521
-     * @return string
522
-     */
523
-    protected function _preview()
524
-    {
525
-        return $this->_send_message();
526
-    }
527
-
528
-
529
-    protected function _set_admin_settings_fields()
530
-    {
531
-    }
532
-
533
-
534
-    /**
535
-     * add the "powered by EE" credit link to the HTML receipt and invoice
536
-     *
537
-     * @param string $content
538
-     * @param string $content_again
539
-     * @param \EE_message_type $incoming_message_type
540
-     * @return string
541
-     */
542
-    public function add_powered_by_credit_link_to_receipt_and_invoice(
543
-        $content = '',
544
-        $content_again = '',
545
-        EE_message_type $incoming_message_type
546
-    ) {
547
-        if (
548
-            ($incoming_message_type->name === 'invoice' || $incoming_message_type->name === 'receipt')
549
-            && apply_filters('FHEE_EE_Html_messenger__add_powered_by_credit_link_to_receipt_and_invoice', true)
550
-        ) {
551
-            $content .= \EEH_Template::powered_by_event_espresso(
552
-                'aln-cntr',
553
-                '',
554
-                array('utm_content' => 'messages_system')
555
-            )
556
-                . EEH_HTML::div(EEH_HTML::p('&nbsp;'));
557
-        }
558
-        return $content;
559
-    }
15
+	/**
16
+	 * The following are the properties that this messenger requires for displaying the html
17
+	 */
18
+	/**
19
+	 * This is the html body generated by the template via the message type.
20
+	 *
21
+	 * @var string
22
+	 */
23
+	protected $_content;
24
+
25
+
26
+	/**
27
+	 * This is for the page title that gets displayed.  (Why use "subject"?  Because the "title" tag in html is
28
+	 * equivalent to the "subject" of the page.
29
+	 *
30
+	 * @var string
31
+	 */
32
+	protected $_subject;
33
+
34
+
35
+	/**
36
+	 * EE_Html_messenger constructor.
37
+	 */
38
+	public function __construct()
39
+	{
40
+		// set properties
41
+		$this->name = 'html';
42
+		$this->description = __('This messenger outputs a message to a browser for display.', 'event_espresso');
43
+		$this->label = array(
44
+			'singular' => __('html', 'event_espresso'),
45
+			'plural' => __('html', 'event_espresso'),
46
+		);
47
+		$this->activate_on_install = true;
48
+		// add the "powered by EE" credit link to the HTML receipt and invoice
49
+		add_filter(
50
+			'FHEE__EE_Html_messenger___send_message__main_body',
51
+			array($this, 'add_powered_by_credit_link_to_receipt_and_invoice'),
52
+			10,
53
+			3
54
+		);
55
+		parent::__construct();
56
+	}
57
+
58
+
59
+	/**
60
+	 * HTML Messenger desires execution immediately.
61
+	 *
62
+	 * @see    parent::send_now() for documentation.
63
+	 * @since  4.9.0
64
+	 * @return bool
65
+	 */
66
+	public function send_now()
67
+	{
68
+		return true;
69
+	}
70
+
71
+
72
+	/**
73
+	 * HTML Messenger allows an empty to field.
74
+	 *
75
+	 * @see    parent::allow_empty_to_field() for documentation
76
+	 * @since  4.9.0
77
+	 * @return bool
78
+	 */
79
+	public function allow_empty_to_field()
80
+	{
81
+		return true;
82
+	}
83
+
84
+
85
+	/**
86
+	 * @see abstract declaration in EE_messenger for details.
87
+	 */
88
+	protected function _set_admin_pages()
89
+	{
90
+		$this->admin_registered_pages = array('events_edit' => true);
91
+	}
92
+
93
+
94
+	/**
95
+	 * @see abstract declaration in EE_messenger for details.
96
+	 */
97
+	protected function _set_valid_shortcodes()
98
+	{
99
+		$this->_valid_shortcodes = array();
100
+	}
101
+
102
+
103
+	/**
104
+	 * @see abstract declaration in EE_messenger for details.
105
+	 */
106
+	protected function _set_validator_config()
107
+	{
108
+		$this->_validator_config = array(
109
+			'subject' => array(
110
+				'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction'),
111
+			),
112
+			'content' => array(
113
+				'shortcodes' => array(
114
+					'organization',
115
+					'primary_registration_list',
116
+					'primary_registration_details',
117
+					'email',
118
+					'transaction',
119
+					'event_list',
120
+					'payment_list',
121
+					'venue',
122
+					'line_item_list',
123
+					'messenger',
124
+					'ticket_list',
125
+				),
126
+			),
127
+			'event_list' => array(
128
+				'shortcodes' => array(
129
+					'event',
130
+					'ticket_list',
131
+					'venue',
132
+					'primary_registration_details',
133
+					'primary_registration_list',
134
+					'event_author',
135
+				),
136
+				'required' => array('[EVENT_LIST]'),
137
+			),
138
+			'ticket_list' => array(
139
+				'shortcodes' => array(
140
+					'attendee_list',
141
+					'ticket',
142
+					'datetime_list',
143
+					'primary_registration_details',
144
+					'line_item_list',
145
+					'venue',
146
+				),
147
+				'required' => array('[TICKET_LIST]'),
148
+			),
149
+			'ticket_line_item_no_pms' => array(
150
+				'shortcodes' => array('line_item', 'ticket'),
151
+				'required' => array('[TICKET_LINE_ITEM_LIST]'),
152
+			),
153
+			'ticket_line_item_pms' => array(
154
+				'shortcodes' => array('line_item', 'ticket', 'line_item_list'),
155
+				'required' => array('[TICKET_LINE_ITEM_LIST]'),
156
+			),
157
+			'price_modifier_line_item_list' => array(
158
+				'shortcodes' => array('line_item'),
159
+				'required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]'),
160
+			),
161
+			'datetime_list' => array(
162
+				'shortcodes' => array('datetime'),
163
+				'required' => array('[DATETIME_LIST]'),
164
+			),
165
+			'attendee_list' => array(
166
+				'shortcodes' => array('attendee'),
167
+				'required' => array('[ATTENDEE_LIST]'),
168
+			),
169
+			'tax_line_item_list' => array(
170
+				'shortcodes' => array('line_item'),
171
+				'required' => array('[TAX_LINE_ITEM_LIST]'),
172
+			),
173
+			'additional_line_item_list' => array(
174
+				'shortcodes' => array('line_item'),
175
+				'required' => array('[ADDITIONAL_LINE_ITEM_LIST]'),
176
+			),
177
+			'payment_list' => array(
178
+				'shortcodes' => array('payment'),
179
+				'required' => array('[PAYMENT_LIST_*]'),
180
+			),
181
+		);
182
+	}
183
+
184
+
185
+	/**
186
+	 * This is a method called from EE_messages when this messenger is a generating messenger and the sending messenger
187
+	 * is a different messenger.  Child messengers can set hooks for the sending messenger to callback on if necessary
188
+	 * (i.e. swap out css files or something else).
189
+	 *
190
+	 * @since 4.5.0
191
+	 * @param string $sending_messenger_name the name of the sending messenger so we only set the hooks needed.
192
+	 * @return void
193
+	 */
194
+	public function do_secondary_messenger_hooks($sending_messenger_name)
195
+	{
196
+		if ($sending_messenger_name === 'pdf') {
197
+			add_filter('EE_messenger__get_variation__variation', array($this, 'add_html_css'), 10, 8);
198
+		}
199
+	}
200
+
201
+
202
+	/**
203
+	 * @param                            $variation_path
204
+	 * @param \EE_Messages_Template_Pack $template_pack
205
+	 * @param                            $messenger_name
206
+	 * @param                            $message_type_name
207
+	 * @param                            $url
208
+	 * @param                            $type
209
+	 * @param                            $variation
210
+	 * @param                            $skip_filters
211
+	 * @return string
212
+	 */
213
+	public function add_html_css(
214
+		$variation_path,
215
+		EE_Messages_Template_Pack $template_pack,
216
+		$messenger_name,
217
+		$message_type_name,
218
+		$url,
219
+		$type,
220
+		$variation,
221
+		$skip_filters
222
+	) {
223
+		$variation = $template_pack->get_variation(
224
+			$this->name,
225
+			$message_type_name,
226
+			$type,
227
+			$variation,
228
+			$url,
229
+			'.css',
230
+			$skip_filters
231
+		);
232
+		return $variation;
233
+	}
234
+
235
+
236
+	/**
237
+	 * Takes care of enqueuing any necessary scripts or styles for the page.  A do_action() so message types using this
238
+	 * messenger can add their own js.
239
+	 *
240
+	 * @return void.
241
+	 */
242
+	public function enqueue_scripts_styles()
243
+	{
244
+		parent::enqueue_scripts_styles();
245
+		do_action('AHEE__EE_Html_messenger__enqueue_scripts_styles');
246
+	}
247
+
248
+
249
+	/**
250
+	 * _set_template_fields
251
+	 * This sets up the fields that a messenger requires for the message to go out.
252
+	 *
253
+	 * @access  protected
254
+	 * @return void
255
+	 */
256
+	protected function _set_template_fields()
257
+	{
258
+		// any extra template fields that are NOT used by the messenger
259
+		// but will get used by a messenger field for shortcode replacement
260
+		// get added to the 'extra' key in an associated array
261
+		// indexed by the messenger field they relate to.
262
+		// This is important for the Messages_admin to know what fields to display to the user.
263
+		// Also, notice that the "values" are equal to the field type
264
+		// that messages admin will use to know what kind of field to display.
265
+		// The values ALSO have one index labeled "shortcode".
266
+		// The values in that array indicate which ACTUAL SHORTCODE (i.e. [SHORTCODE])
267
+		// is required in order for this extra field to be displayed.
268
+		//  If the required shortcode isn't part of the shortcodes array
269
+		// then the field is not needed and will not be displayed/parsed.
270
+		$this->_template_fields = array(
271
+			'subject' => array(
272
+				'input' => 'text',
273
+				'label' => __('Page Title', 'event_espresso'),
274
+				'type' => 'string',
275
+				'required' => true,
276
+				'validation' => true,
277
+				'css_class' => 'large-text',
278
+				'format' => '%s',
279
+			),
280
+			'content' => '',
281
+			// left empty b/c it is in the "extra array" but messenger still needs needs to know this is a field.
282
+			'extra' => array(
283
+				'content' => array(
284
+					'main' => array(
285
+						'input' => 'wp_editor',
286
+						'label' => __('Main Content', 'event_espresso'),
287
+						'type' => 'string',
288
+						'required' => true,
289
+						'validation' => true,
290
+						'format' => '%s',
291
+						'rows' => '15',
292
+					),
293
+					'event_list' => array(
294
+						'input' => 'wp_editor',
295
+						'label' => '[EVENT_LIST]',
296
+						'type' => 'string',
297
+						'required' => true,
298
+						'validation' => true,
299
+						'format' => '%s',
300
+						'rows' => '15',
301
+						'shortcodes_required' => array('[EVENT_LIST]'),
302
+					),
303
+					'ticket_list' => array(
304
+						'input' => 'textarea',
305
+						'label' => '[TICKET_LIST]',
306
+						'type' => 'string',
307
+						'required' => true,
308
+						'validation' => true,
309
+						'format' => '%s',
310
+						'css_class' => 'large-text',
311
+						'rows' => '10',
312
+						'shortcodes_required' => array('[TICKET_LIST]'),
313
+					),
314
+					'ticket_line_item_no_pms' => array(
315
+						'input' => 'textarea',
316
+						'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __(
317
+							'Ticket Line Item List with no Price Modifiers',
318
+							'event_espresso'
319
+						),
320
+						'type' => 'string',
321
+						'required' => false,
322
+						'validation' => true,
323
+						'format' => '%s',
324
+						'css_class' => 'large-text',
325
+						'rows' => '5',
326
+						'shortcodes_required' => array('[TICKET_LINE_ITEM_LIST]'),
327
+					),
328
+					'ticket_line_item_pms' => array(
329
+						'input' => 'textarea',
330
+						'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __(
331
+							'Ticket Line Item List with Price Modifiers',
332
+							'event_espresso'
333
+						),
334
+						'type' => 'string',
335
+						'required' => false,
336
+						'validation' => true,
337
+						'format' => '%s',
338
+						'css_class' => 'large-text',
339
+						'rows' => '5',
340
+						'shortcodes_required' => array('[TICKET_LINE_ITEM_LIST]'),
341
+					),
342
+					'price_modifier_line_item_list' => array(
343
+						'input' => 'textarea',
344
+						'label' => '[PRICE_MODIFIER_LINE_ITEM_LIST]',
345
+						'type' => 'string',
346
+						'required' => false,
347
+						'validation' => true,
348
+						'format' => '%s',
349
+						'css_class' => 'large-text',
350
+						'rows' => '5',
351
+						'shortcodes_required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]'),
352
+					),
353
+					'datetime_list' => array(
354
+						'input' => 'textarea',
355
+						'label' => '[DATETIME_LIST]',
356
+						'type' => 'string',
357
+						'required' => true,
358
+						'validation' => true,
359
+						'format' => '%s',
360
+						'css_class' => 'large-text',
361
+						'rows' => '5',
362
+						'shortcodes_required' => array('[DATETIME_LIST]'),
363
+					),
364
+					'attendee_list' => array(
365
+						'input' => 'textarea',
366
+						'label' => '[ATTENDEE_LIST]',
367
+						'type' => 'string',
368
+						'required' => true,
369
+						'validation' => true,
370
+						'format' => '%s',
371
+						'css_class' => 'large-text',
372
+						'rows' => '5',
373
+						'shortcodes_required' => array('[ATTENDEE_LIST]'),
374
+					),
375
+					'tax_line_item_list' => array(
376
+						'input' => 'textarea',
377
+						'label' => '[TAX_LINE_ITEM_LIST]',
378
+						'type' => 'string',
379
+						'required' => false,
380
+						'validation' => true,
381
+						'format' => '%s',
382
+						'css_class' => 'large-text',
383
+						'rows' => '5',
384
+						'shortcodes_required' => array('[TAX_LINE_ITEM_LIST]'),
385
+					),
386
+					'additional_line_item_list' => array(
387
+						'input' => 'textarea',
388
+						'label' => '[ADDITIONAL_LINE_ITEM_LIST]',
389
+						'type' => 'string',
390
+						'required' => false,
391
+						'validation' => true,
392
+						'format' => '%s',
393
+						'css_class' => 'large-text',
394
+						'rows' => '5',
395
+						'shortcodes_required' => array('[ADDITIONAL_LINE_ITEM_LIST]'),
396
+					),
397
+					'payment_list' => array(
398
+						'input' => 'textarea',
399
+						'label' => '[PAYMENT_LIST]',
400
+						'type' => 'string',
401
+						'required' => true,
402
+						'validation' => true,
403
+						'format' => '%s',
404
+						'css_class' => 'large-text',
405
+						'rows' => '5',
406
+						'shortcodes_required' => array('[PAYMENT_LIST_*]'),
407
+					),
408
+				),
409
+			),
410
+		);
411
+	}
412
+
413
+
414
+	/**
415
+	 * @see   definition of this method in parent
416
+	 * @since 4.5.0
417
+	 */
418
+	protected function _set_default_message_types()
419
+	{
420
+		$this->_default_message_types = array('receipt', 'invoice');
421
+	}
422
+
423
+
424
+	/**
425
+	 * @see   definition of this method in parent
426
+	 * @since 4.5.0
427
+	 */
428
+	protected function _set_valid_message_types()
429
+	{
430
+		$this->_valid_message_types = array('receipt', 'invoice');
431
+	}
432
+
433
+
434
+	/**
435
+	 * Displays the message in the browser.
436
+	 *
437
+	 * @since 4.5.0
438
+	 * @return string.
439
+	 */
440
+	protected function _send_message()
441
+	{
442
+		$this->_template_args = array(
443
+			'page_title' => $this->_subject,
444
+			'base_css' => $this->get_variation(
445
+				$this->_tmp_pack,
446
+				$this->_incoming_message_type->name,
447
+				true,
448
+				'base',
449
+				$this->_variation
450
+			),
451
+			'print_css' => $this->get_variation(
452
+				$this->_tmp_pack,
453
+				$this->_incoming_message_type->name,
454
+				true,
455
+				'print',
456
+				$this->_variation
457
+			),
458
+			'main_css' => $this->get_variation(
459
+				$this->_tmp_pack,
460
+				$this->_incoming_message_type->name,
461
+				true,
462
+				'main',
463
+				$this->_variation
464
+			),
465
+			'main_body' => wpautop(
466
+				apply_filters(
467
+					'FHEE__EE_Html_messenger___send_message__main_body',
468
+					$this->_content,
469
+					$this->_content,
470
+					$this->_incoming_message_type
471
+				)
472
+			)
473
+		);
474
+		$this->_deregister_wp_hooks();
475
+		add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles'));
476
+		echo $this->_get_main_template();
477
+		exit();
478
+	}
479
+
480
+
481
+	/**
482
+	 * The purpose of this function is to de register all actions hooked into wp_head and wp_footer so that it doesn't
483
+	 * interfere with our templates.  If users want to add any custom styles or scripts they must use the
484
+	 * AHEE__EE_Html_messenger__enqueue_scripts_styles hook.
485
+	 *
486
+	 * @since 4.5.0
487
+	 * @return void
488
+	 */
489
+	protected function _deregister_wp_hooks()
490
+	{
491
+		remove_all_actions('wp_head');
492
+		remove_all_actions('wp_footer');
493
+		remove_all_actions('wp_print_footer_scripts');
494
+		remove_all_actions('wp_enqueue_scripts');
495
+		global $wp_scripts, $wp_styles;
496
+		$wp_scripts = $wp_styles = array();
497
+		// just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load.
498
+		add_action('wp_footer', 'wp_print_footer_scripts');
499
+		add_action('wp_print_footer_scripts', '_wp_footer_scripts');
500
+		add_action('wp_head', 'wp_enqueue_scripts');
501
+	}
502
+
503
+
504
+	/**
505
+	 * Overwrite parent _get_main_template for display_html purposes.
506
+	 *
507
+	 * @since  4.5.0
508
+	 * @param bool $preview
509
+	 * @return string
510
+	 */
511
+	protected function _get_main_template($preview = false)
512
+	{
513
+		$wrapper_template = $this->_tmp_pack->get_wrapper($this->name, 'main');
514
+		// include message type as a template arg
515
+		$this->_template_args['message_type'] = $this->_incoming_message_type;
516
+		return EEH_Template::display_template($wrapper_template, $this->_template_args, true);
517
+	}
518
+
519
+
520
+	/**
521
+	 * @return string
522
+	 */
523
+	protected function _preview()
524
+	{
525
+		return $this->_send_message();
526
+	}
527
+
528
+
529
+	protected function _set_admin_settings_fields()
530
+	{
531
+	}
532
+
533
+
534
+	/**
535
+	 * add the "powered by EE" credit link to the HTML receipt and invoice
536
+	 *
537
+	 * @param string $content
538
+	 * @param string $content_again
539
+	 * @param \EE_message_type $incoming_message_type
540
+	 * @return string
541
+	 */
542
+	public function add_powered_by_credit_link_to_receipt_and_invoice(
543
+		$content = '',
544
+		$content_again = '',
545
+		EE_message_type $incoming_message_type
546
+	) {
547
+		if (
548
+			($incoming_message_type->name === 'invoice' || $incoming_message_type->name === 'receipt')
549
+			&& apply_filters('FHEE_EE_Html_messenger__add_powered_by_credit_link_to_receipt_and_invoice', true)
550
+		) {
551
+			$content .= \EEH_Template::powered_by_event_espresso(
552
+				'aln-cntr',
553
+				'',
554
+				array('utm_content' => 'messages_system')
555
+			)
556
+				. EEH_HTML::div(EEH_HTML::p('&nbsp;'));
557
+		}
558
+		return $content;
559
+	}
560 560
 }
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messages_Data_Handler_Collection.lib.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     public function get_key($classname, $data)
48 48
     {
49
-        return md5($classname . serialize($data));
49
+        return md5($classname.serialize($data));
50 50
     }
51 51
 
52 52
 
Please login to merge, or discard this patch.
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -11,69 +11,69 @@
 block discarded – undo
11 11
 {
12 12
 
13 13
 
14
-    public function __construct()
15
-    {
16
-        $this->interface = 'EE_Messages_incoming_data';
17
-    }
18
-
19
-
20
-    /**
21
-     * This adds the EE_Messages_incoming_data data handler object to the collection.
22
-     *
23
-     * @param EE_Messages_incoming_data  $data_handler
24
-     * @param mixed                      $data           Usually an array of data used in combination with the $data_handler
25
-     *                                                   classname to create an alternative index for retrieving data_handlers.
26
-     * @return bool
27
-     */
28
-    public function add($data_handler, $data = null)
29
-    {
30
-        $data = $data === null ? array() : (array) $data;
31
-        $info['key'] = $this->get_key(get_class($data_handler), $data);
32
-        return parent::add($data_handler, $info);
33
-    }
34
-
35
-
36
-
37
-
38
-
39
-    /**
40
-     * This returns a key for retrieving data for the given references used to generate the key.
41
-     * Data handlers are cached to the repository along with a md5() generated key using known references.
42
-     * @param string    $classname      The classname of the datahandler being checked for.
43
-     * @param mixed     $data           The data that was used to instantiate the data_handler.
44
-     *
45
-     * @return  string      md5 hash using provided info.
46
-     */
47
-    public function get_key($classname, $data)
48
-    {
49
-        return md5($classname . serialize($data));
50
-    }
51
-
52
-
53
-
54
-
55
-
56
-
57
-    /**
58
-     * This returns a saved EE_Messages_incoming_data object if there is one in the repository indexed by a key matching
59
-     * the given string.
60
-     *
61
-     * @param string  $key  @see EE_Messages_Data_Handler_Collection::get_key() to setup a key formatted for searching.
62
-     *
63
-     * @return null|EE_Messages_incoming_data
64
-     */
65
-    public function get_by_key($key)
66
-    {
67
-        $this->rewind();
68
-        while ($this->valid()) {
69
-            $data = $this->getInfo();
70
-            if (isset($data['key']) && $data['key'] === $key) {
71
-                $handler = $this->current();
72
-                $this->rewind();
73
-                return $handler;
74
-            }
75
-            $this->next();
76
-        }
77
-        return null;
78
-    }
14
+	public function __construct()
15
+	{
16
+		$this->interface = 'EE_Messages_incoming_data';
17
+	}
18
+
19
+
20
+	/**
21
+	 * This adds the EE_Messages_incoming_data data handler object to the collection.
22
+	 *
23
+	 * @param EE_Messages_incoming_data  $data_handler
24
+	 * @param mixed                      $data           Usually an array of data used in combination with the $data_handler
25
+	 *                                                   classname to create an alternative index for retrieving data_handlers.
26
+	 * @return bool
27
+	 */
28
+	public function add($data_handler, $data = null)
29
+	{
30
+		$data = $data === null ? array() : (array) $data;
31
+		$info['key'] = $this->get_key(get_class($data_handler), $data);
32
+		return parent::add($data_handler, $info);
33
+	}
34
+
35
+
36
+
37
+
38
+
39
+	/**
40
+	 * This returns a key for retrieving data for the given references used to generate the key.
41
+	 * Data handlers are cached to the repository along with a md5() generated key using known references.
42
+	 * @param string    $classname      The classname of the datahandler being checked for.
43
+	 * @param mixed     $data           The data that was used to instantiate the data_handler.
44
+	 *
45
+	 * @return  string      md5 hash using provided info.
46
+	 */
47
+	public function get_key($classname, $data)
48
+	{
49
+		return md5($classname . serialize($data));
50
+	}
51
+
52
+
53
+
54
+
55
+
56
+
57
+	/**
58
+	 * This returns a saved EE_Messages_incoming_data object if there is one in the repository indexed by a key matching
59
+	 * the given string.
60
+	 *
61
+	 * @param string  $key  @see EE_Messages_Data_Handler_Collection::get_key() to setup a key formatted for searching.
62
+	 *
63
+	 * @return null|EE_Messages_incoming_data
64
+	 */
65
+	public function get_by_key($key)
66
+	{
67
+		$this->rewind();
68
+		while ($this->valid()) {
69
+			$data = $this->getInfo();
70
+			if (isset($data['key']) && $data['key'] === $key) {
71
+				$handler = $this->current();
72
+				$this->rewind();
73
+				return $handler;
74
+			}
75
+			$this->next();
76
+		}
77
+		return null;
78
+	}
79 79
 }
Please login to merge, or discard this patch.
core/libraries/messages/EE_Payment_Base_message_type.lib.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -15,67 +15,67 @@
 block discarded – undo
15 15
 
16 16
 
17 17
 
18
-    /**
19
-     * @see parent::get_priority() for documentation.
20
-     * @return int
21
-     */
22
-    public function get_priority()
23
-    {
24
-        return EEM_Message::priority_high;
25
-    }
18
+	/**
19
+	 * @see parent::get_priority() for documentation.
20
+	 * @return int
21
+	 */
22
+	public function get_priority()
23
+	{
24
+		return EEM_Message::priority_high;
25
+	}
26 26
 
27 27
 
28 28
 
29 29
 
30
-    /**
31
-     * see abstract declaration in parent class for details.
32
-     */
33
-    protected function _set_admin_pages()
34
-    {
35
-        $this->admin_registered_pages = array(
36
-            'events_edit' => true
37
-            );
38
-    }
30
+	/**
31
+	 * see abstract declaration in parent class for details.
32
+	 */
33
+	protected function _set_admin_pages()
34
+	{
35
+		$this->admin_registered_pages = array(
36
+			'events_edit' => true
37
+			);
38
+	}
39 39
 
40 40
 
41 41
 
42
-    protected function _set_data_handler()
43
-    {
44
-        $this->_data_handler = 'Gateways';
45
-    }
42
+	protected function _set_data_handler()
43
+	{
44
+		$this->_data_handler = 'Gateways';
45
+	}
46 46
 
47 47
 
48 48
 
49 49
 
50
-    protected function _get_data_for_context($context, EE_Registration $registration, $id)
51
-    {
50
+	protected function _get_data_for_context($context, EE_Registration $registration, $id)
51
+	{
52 52
 
53
-        // use the registration to get the transaction.
54
-        $transaction = $registration->transaction();
53
+		// use the registration to get the transaction.
54
+		$transaction = $registration->transaction();
55 55
 
56
-        // bail early if no transaction
57
-        if (! $transaction instanceof EE_Transaction) {
58
-            throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
59
-        }
56
+		// bail early if no transaction
57
+		if (! $transaction instanceof EE_Transaction) {
58
+			throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
59
+		}
60 60
 
61
-        $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0;
61
+		$payment = ! empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0;
62 62
 
63
-        return array( $transaction, $payment );
64
-    }
63
+		return array( $transaction, $payment );
64
+	}
65 65
 
66 66
 
67 67
 
68
-    protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger)
69
-    {
70
-        // this is just a test
71
-        return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
72
-    }
68
+	protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger)
69
+	{
70
+		// this is just a test
71
+		return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
72
+	}
73 73
 
74
-    /**
75
-     * This message type doesn't need any settings so we are just setting to empty array.
76
-     */
77
-    protected function _set_admin_settings_fields()
78
-    {
79
-        $this->_admin_settings_fields = array();
80
-    }
74
+	/**
75
+	 * This message type doesn't need any settings so we are just setting to empty array.
76
+	 */
77
+	protected function _set_admin_settings_fields()
78
+	{
79
+		$this->_admin_settings_fields = array();
80
+	}
81 81
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
         $transaction = $registration->transaction();
55 55
 
56 56
         // bail early if no transaction
57
-        if (! $transaction instanceof EE_Transaction) {
57
+        if ( ! $transaction instanceof EE_Transaction) {
58 58
             throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
59 59
         }
60 60
 
61
-        $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0;
61
+        $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array(array('PAY_ID' => $id, 'TXN_ID' => $transaction->ID()))) : 0;
62 62
 
63
-        return array( $transaction, $payment );
63
+        return array($transaction, $payment);
64 64
     }
65 65
 
66 66
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger)
69 69
     {
70 70
         // this is just a test
71
-        return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
71
+        return $this->name.' Message Type for '.$messenger->name.' Messenger ';
72 72
     }
73 73
 
74 74
     /**
Please login to merge, or discard this patch.
core/libraries/messages/EE_Registration_Base_message_type.lib.php 2 patches
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -14,126 +14,126 @@
 block discarded – undo
14 14
 {
15 15
 
16 16
 
17
-    /**
18
-     * @see parent::get_priority() for documentation.
19
-     * @return int
20
-     */
21
-    public function get_priority()
22
-    {
23
-        return EEM_Message::priority_medium;
24
-    }
25
-
26
-
27
-
28
-    protected function _set_admin_pages()
29
-    {
30
-        $this->admin_registered_pages = array(
31
-            'events_edit' => true
32
-            );
33
-    }
34
-
35
-
36
-    protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger)
37
-    {
38
-        // this is just a test
39
-        return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
40
-    }
41
-
42
-
43
-
44
-
45
-    protected function _set_data_handler()
46
-    {
47
-        if (is_array($this->_data)) {
48
-            $data_type = reset($this->_data);
49
-
50
-            if (is_array($data_type)) {
51
-                // grab the first item and see if its a registration.
52
-                $maybe_reg = isset($data_type[0]) && is_array($data_type[0]) ? reset($data_type[0]) : reset($data_type);
53
-                if ($maybe_reg instanceof EE_Registration) {
54
-                    // is $data_type itself just an array of registrations?
55
-                    if (isset($data_type[1]) && $data_type[1] instanceof EE_Registration) {
56
-                        $regs = $data_type;
57
-                    } else {
58
-                        $regs = is_array($data_type[0]) ? $data_type[0] : array( $maybe_reg );
59
-                    }
60
-
61
-                    foreach ($regs as $reg) {
62
-                        if ($reg instanceof EE_Registration) {
63
-                            $this->_regs_for_sending[] = $reg->ID();
64
-                        }
65
-                    }
66
-                    $this->_data = isset($this->_data[1]) ? array( $maybe_reg->transaction(), null, $this->_data[1] ) : array( $maybe_reg->transaction() );
67
-                    $this->_data_handler = 'Gateways';
68
-                } else {
69
-                    $this->_data_handler = 'Gateways';
70
-                }
71
-            } else {
72
-                $this->_data_handler = $data_type instanceof EE_Registration ? 'REG' : 'Gateways';
73
-            }
74
-        } else {
75
-            $this->_data_handler = $this->_data instanceof EE_Registration ? 'REG' : 'Gateways';
76
-        }
77
-
78
-        $this->_single_message = $this->_data_handler == 'REG' ? true : false;
79
-    }
80
-
81
-
82
-
83
-    protected function _get_data_for_context($context, EE_Registration $registration, $id)
84
-    {
85
-        if ($context  == 'admin') {
86
-            // use the registration to get the transaction.
87
-            $transaction = $registration->transaction();
88
-
89
-            // bail early if no transaction
90
-            if (! $transaction instanceof EE_Transaction) {
91
-                throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
92
-            }
93
-
94
-            $payment = !empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0;
95
-            return array( $transaction, $payment );
96
-        } else {
97
-            return $registration;
98
-        }
99
-    }
100
-
101
-
102
-
103
-    /**
104
-     * Setup admin settings for this message type.
105
-     */
106
-    protected function _set_admin_settings_fields()
107
-    {
108
-        $this->_admin_settings_fields = array();
109
-    }
110
-
111
-
112
-
113
-
114
-
115
-    /**
116
-     * returns an array of addressee objects for event_admins
117
-     *
118
-     * @access protected
119
-     * @return array array of EE_Messages_Addressee objects
120
-     */
121
-    protected function _admin_addressees()
122
-    {
123
-        if ($this->_single_message) {
124
-            return array();
125
-        }
126
-        return parent::_admin_addressees();
127
-    }
128
-
129
-
130
-
131
-    protected function _primary_attendee_addressees()
132
-    {
133
-        if ($this->_single_message) {
134
-            return array();
135
-        }
136
-
137
-        return parent::_primary_attendee_addressees();
138
-    }
17
+	/**
18
+	 * @see parent::get_priority() for documentation.
19
+	 * @return int
20
+	 */
21
+	public function get_priority()
22
+	{
23
+		return EEM_Message::priority_medium;
24
+	}
25
+
26
+
27
+
28
+	protected function _set_admin_pages()
29
+	{
30
+		$this->admin_registered_pages = array(
31
+			'events_edit' => true
32
+			);
33
+	}
34
+
35
+
36
+	protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger)
37
+	{
38
+		// this is just a test
39
+		return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
40
+	}
41
+
42
+
43
+
44
+
45
+	protected function _set_data_handler()
46
+	{
47
+		if (is_array($this->_data)) {
48
+			$data_type = reset($this->_data);
49
+
50
+			if (is_array($data_type)) {
51
+				// grab the first item and see if its a registration.
52
+				$maybe_reg = isset($data_type[0]) && is_array($data_type[0]) ? reset($data_type[0]) : reset($data_type);
53
+				if ($maybe_reg instanceof EE_Registration) {
54
+					// is $data_type itself just an array of registrations?
55
+					if (isset($data_type[1]) && $data_type[1] instanceof EE_Registration) {
56
+						$regs = $data_type;
57
+					} else {
58
+						$regs = is_array($data_type[0]) ? $data_type[0] : array( $maybe_reg );
59
+					}
60
+
61
+					foreach ($regs as $reg) {
62
+						if ($reg instanceof EE_Registration) {
63
+							$this->_regs_for_sending[] = $reg->ID();
64
+						}
65
+					}
66
+					$this->_data = isset($this->_data[1]) ? array( $maybe_reg->transaction(), null, $this->_data[1] ) : array( $maybe_reg->transaction() );
67
+					$this->_data_handler = 'Gateways';
68
+				} else {
69
+					$this->_data_handler = 'Gateways';
70
+				}
71
+			} else {
72
+				$this->_data_handler = $data_type instanceof EE_Registration ? 'REG' : 'Gateways';
73
+			}
74
+		} else {
75
+			$this->_data_handler = $this->_data instanceof EE_Registration ? 'REG' : 'Gateways';
76
+		}
77
+
78
+		$this->_single_message = $this->_data_handler == 'REG' ? true : false;
79
+	}
80
+
81
+
82
+
83
+	protected function _get_data_for_context($context, EE_Registration $registration, $id)
84
+	{
85
+		if ($context  == 'admin') {
86
+			// use the registration to get the transaction.
87
+			$transaction = $registration->transaction();
88
+
89
+			// bail early if no transaction
90
+			if (! $transaction instanceof EE_Transaction) {
91
+				throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
92
+			}
93
+
94
+			$payment = !empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0;
95
+			return array( $transaction, $payment );
96
+		} else {
97
+			return $registration;
98
+		}
99
+	}
100
+
101
+
102
+
103
+	/**
104
+	 * Setup admin settings for this message type.
105
+	 */
106
+	protected function _set_admin_settings_fields()
107
+	{
108
+		$this->_admin_settings_fields = array();
109
+	}
110
+
111
+
112
+
113
+
114
+
115
+	/**
116
+	 * returns an array of addressee objects for event_admins
117
+	 *
118
+	 * @access protected
119
+	 * @return array array of EE_Messages_Addressee objects
120
+	 */
121
+	protected function _admin_addressees()
122
+	{
123
+		if ($this->_single_message) {
124
+			return array();
125
+		}
126
+		return parent::_admin_addressees();
127
+	}
128
+
129
+
130
+
131
+	protected function _primary_attendee_addressees()
132
+	{
133
+		if ($this->_single_message) {
134
+			return array();
135
+		}
136
+
137
+		return parent::_primary_attendee_addressees();
138
+	}
139 139
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     protected function _get_admin_content_events_edit_for_messenger(EE_messenger $messenger)
37 37
     {
38 38
         // this is just a test
39
-        return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
39
+        return $this->name.' Message Type for '.$messenger->name.' Messenger ';
40 40
     }
41 41
 
42 42
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                     if (isset($data_type[1]) && $data_type[1] instanceof EE_Registration) {
56 56
                         $regs = $data_type;
57 57
                     } else {
58
-                        $regs = is_array($data_type[0]) ? $data_type[0] : array( $maybe_reg );
58
+                        $regs = is_array($data_type[0]) ? $data_type[0] : array($maybe_reg);
59 59
                     }
60 60
 
61 61
                     foreach ($regs as $reg) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                             $this->_regs_for_sending[] = $reg->ID();
64 64
                         }
65 65
                     }
66
-                    $this->_data = isset($this->_data[1]) ? array( $maybe_reg->transaction(), null, $this->_data[1] ) : array( $maybe_reg->transaction() );
66
+                    $this->_data = isset($this->_data[1]) ? array($maybe_reg->transaction(), null, $this->_data[1]) : array($maybe_reg->transaction());
67 67
                     $this->_data_handler = 'Gateways';
68 68
                 } else {
69 69
                     $this->_data_handler = 'Gateways';
@@ -82,17 +82,17 @@  discard block
 block discarded – undo
82 82
 
83 83
     protected function _get_data_for_context($context, EE_Registration $registration, $id)
84 84
     {
85
-        if ($context  == 'admin') {
85
+        if ($context == 'admin') {
86 86
             // use the registration to get the transaction.
87 87
             $transaction = $registration->transaction();
88 88
 
89 89
             // bail early if no transaction
90
-            if (! $transaction instanceof EE_Transaction) {
90
+            if ( ! $transaction instanceof EE_Transaction) {
91 91
                 throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
92 92
             }
93 93
 
94
-            $payment = !empty($id) ? EEM_Payment::instance()->get_one(array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) )) : 0;
95
-            return array( $transaction, $payment );
94
+            $payment = ! empty($id) ? EEM_Payment::instance()->get_one(array(array('PAY_ID' => $id, 'TXN_ID' => $transaction->ID()))) : 0;
95
+            return array($transaction, $payment);
96 96
         } else {
97 97
             return $registration;
98 98
         }
Please login to merge, or discard this patch.
libraries/messages/message_type/EE_Payment_Refund_message_type.class.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -15,50 +15,50 @@
 block discarded – undo
15 15
 class EE_Payment_Refund_message_type extends EE_Payment_Base_message_type
16 16
 {
17 17
 
18
-    public function __construct()
19
-    {
18
+	public function __construct()
19
+	{
20 20
 
21
-        // setup type details for reference
22
-        $this->name = 'payment_refund';
23
-        $this->description = __('This message type is used for all payment notification messages that go out for refunds.', 'event_espresso');
24
-        $this->label = array(
25
-            'singular' => __('refund issued', 'event_espresso'),
26
-            'plural' => __('refunds issued', 'event_espresso')
27
-            );
21
+		// setup type details for reference
22
+		$this->name = 'payment_refund';
23
+		$this->description = __('This message type is used for all payment notification messages that go out for refunds.', 'event_espresso');
24
+		$this->label = array(
25
+			'singular' => __('refund issued', 'event_espresso'),
26
+			'plural' => __('refunds issued', 'event_espresso')
27
+			);
28 28
 
29
-        $this->_master_templates = array(
30
-            'email' => 'payment'
31
-            );
29
+		$this->_master_templates = array(
30
+			'email' => 'payment'
31
+			);
32 32
 
33
-        parent::__construct();
34
-    }
33
+		parent::__construct();
34
+	}
35 35
 
36 36
 
37 37
 
38
-    /**
39
-     * _set_contexts
40
-     * This sets up the contexts associated with the message_type
41
-     *
42
-     * @access  protected
43
-     * @return  void
44
-     */
45
-    protected function _set_contexts()
46
-    {
47
-        $this->_context_label = array(
48
-            'label' => __('recipient', 'event_espresso'),
49
-            'plural' => __('recipients', 'event_espresso'),
50
-            'description' => __('Recipient\'s are who will receive the template.  You may want different payment details sent out depending on who the recipient is', 'event_espresso')
51
-            );
38
+	/**
39
+	 * _set_contexts
40
+	 * This sets up the contexts associated with the message_type
41
+	 *
42
+	 * @access  protected
43
+	 * @return  void
44
+	 */
45
+	protected function _set_contexts()
46
+	{
47
+		$this->_context_label = array(
48
+			'label' => __('recipient', 'event_espresso'),
49
+			'plural' => __('recipients', 'event_espresso'),
50
+			'description' => __('Recipient\'s are who will receive the template.  You may want different payment details sent out depending on who the recipient is', 'event_espresso')
51
+			);
52 52
 
53
-        $this->_contexts = array(
54
-            'admin' => array(
55
-                'label' => __('Event Admin', 'event_espresso'),
56
-                'description' => __('This template is what event administrators will receive on a successful refund.', 'event_espresso')
57
-                ),
58
-            'primary_attendee' => array(
59
-                'label' => __('Primary Registrant', 'event_espresso'),
60
-                'description' => __('This template is what the primary registrant (the person who made the main registration) will receive on successful refund.', 'event_espresso')
61
-                )
62
-            );
63
-    }
53
+		$this->_contexts = array(
54
+			'admin' => array(
55
+				'label' => __('Event Admin', 'event_espresso'),
56
+				'description' => __('This template is what event administrators will receive on a successful refund.', 'event_espresso')
57
+				),
58
+			'primary_attendee' => array(
59
+				'label' => __('Primary Registrant', 'event_espresso'),
60
+				'description' => __('This template is what the primary registrant (the person who made the main registration) will receive on successful refund.', 'event_espresso')
61
+				)
62
+			);
63
+	}
64 64
 }
Please login to merge, or discard this patch.
core/libraries/messages/message_type/EE_Registration_message_type.class.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -14,48 +14,48 @@
 block discarded – undo
14 14
 class EE_Registration_message_type extends EE_Registration_Base_message_type
15 15
 {
16 16
 
17
-    public function __construct()
18
-    {
19
-        $this->name = 'registration';
20
-        $this->description = __('This message type is for messages sent to attendees when their registration is approved.', 'event_espresso');
21
-        $this->label = array(
22
-            'singular' => __('registration approved', 'event_espresso'),
23
-            'plural' => __('registrations approved', 'event_espresso')
24
-            );
17
+	public function __construct()
18
+	{
19
+		$this->name = 'registration';
20
+		$this->description = __('This message type is for messages sent to attendees when their registration is approved.', 'event_espresso');
21
+		$this->label = array(
22
+			'singular' => __('registration approved', 'event_espresso'),
23
+			'plural' => __('registrations approved', 'event_espresso')
24
+			);
25 25
 
26
-        parent::__construct();
27
-    }
26
+		parent::__construct();
27
+	}
28 28
 
29 29
 
30 30
 
31
-    /**
32
-     * _set_contexts
33
-     * This sets up the contexts associated with the message_type
34
-     *
35
-     * @access  protected
36
-     * @return  void
37
-     */
38
-    protected function _set_contexts()
39
-    {
40
-        $this->_context_label = array(
41
-            'label' => __('recipient', 'event_espresso'),
42
-            'plural' => __('recipients', 'event_espresso'),
43
-            'description' => __('Recipient\'s are who will receive the template.  You may want different registration details sent out depending on who the recipient is', 'event_espresso')
44
-            );
31
+	/**
32
+	 * _set_contexts
33
+	 * This sets up the contexts associated with the message_type
34
+	 *
35
+	 * @access  protected
36
+	 * @return  void
37
+	 */
38
+	protected function _set_contexts()
39
+	{
40
+		$this->_context_label = array(
41
+			'label' => __('recipient', 'event_espresso'),
42
+			'plural' => __('recipients', 'event_espresso'),
43
+			'description' => __('Recipient\'s are who will receive the template.  You may want different registration details sent out depending on who the recipient is', 'event_espresso')
44
+			);
45 45
 
46
-        $this->_contexts = array(
47
-            'admin' => array(
48
-                'label' => __('Event Admin', 'event_espresso'),
49
-                'description' => __('This template is what event administrators will receive with an approved registration', 'event_espresso')
50
-                ),
51
-            'primary_attendee' => array(
52
-                'label' => __('Primary Registrant', 'event_espresso'),
53
-                'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive with approved registration', 'event_espresso')
54
-                ),
55
-            'attendee' => array(
56
-                'label' => __('Registrant', 'event_espresso'),
57
-                'description' => __('This template is what each registrant for the event will receive when their registration is approved.', 'event_espresso')
58
-                )
59
-            );
60
-    }
46
+		$this->_contexts = array(
47
+			'admin' => array(
48
+				'label' => __('Event Admin', 'event_espresso'),
49
+				'description' => __('This template is what event administrators will receive with an approved registration', 'event_espresso')
50
+				),
51
+			'primary_attendee' => array(
52
+				'label' => __('Primary Registrant', 'event_espresso'),
53
+				'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive with approved registration', 'event_espresso')
54
+				),
55
+			'attendee' => array(
56
+				'label' => __('Registrant', 'event_espresso'),
57
+				'description' => __('This template is what each registrant for the event will receive when their registration is approved.', 'event_espresso')
58
+				)
59
+			);
60
+	}
61 61
 }
Please login to merge, or discard this patch.
messages/message_type/EE_Not_Approved_Registration_message_type.class.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -14,60 +14,60 @@
 block discarded – undo
14 14
 class EE_Not_Approved_Registration_message_type extends EE_Registration_Base_message_type
15 15
 {
16 16
 
17
-    public function __construct()
18
-    {
19
-        $this->name = 'not_approved_registration';
20
-        $this->description = __('This message type is for messages sent to registrants when their registration is set to the not approved status.', 'event_espresso');
21
-        $this->label = array(
22
-            'singular' => __('not approved registration', 'event_espresso'),
23
-            'plural' => __('not approved registrations', 'event_espresso')
24
-            );
17
+	public function __construct()
18
+	{
19
+		$this->name = 'not_approved_registration';
20
+		$this->description = __('This message type is for messages sent to registrants when their registration is set to the not approved status.', 'event_espresso');
21
+		$this->label = array(
22
+			'singular' => __('not approved registration', 'event_espresso'),
23
+			'plural' => __('not approved registrations', 'event_espresso')
24
+			);
25 25
 
26
-        $this->_master_templates = array(
27
-            'email' => 'registration'
28
-            );
26
+		$this->_master_templates = array(
27
+			'email' => 'registration'
28
+			);
29 29
 
30
-        parent::__construct();
31
-    }
30
+		parent::__construct();
31
+	}
32 32
 
33 33
 
34 34
 
35 35
 
36
-    /**
37
-     * _set_contexts
38
-     * This sets up the contexts associated with the message_type
39
-     *
40
-     * @access  protected
41
-     * @return  void
42
-     */
43
-    protected function _set_contexts()
44
-    {
45
-        $this->_context_label = array(
46
-            'label' => __('recipient', 'event_espresso'),
47
-            'plural' => __('recipients', 'event_espresso'),
48
-            'description' => __('Recipient\'s are who will receive the template.  You may want different registration details sent out depending on who the recipient is', 'event_espresso')
49
-            );
36
+	/**
37
+	 * _set_contexts
38
+	 * This sets up the contexts associated with the message_type
39
+	 *
40
+	 * @access  protected
41
+	 * @return  void
42
+	 */
43
+	protected function _set_contexts()
44
+	{
45
+		$this->_context_label = array(
46
+			'label' => __('recipient', 'event_espresso'),
47
+			'plural' => __('recipients', 'event_espresso'),
48
+			'description' => __('Recipient\'s are who will receive the template.  You may want different registration details sent out depending on who the recipient is', 'event_espresso')
49
+			);
50 50
 
51
-        $this->_contexts = array(
52
-            'admin' => array(
53
-                'label' => __('Event Admin', 'event_espresso'),
54
-                'description' => __('This template is what event administrators will receive when registration status is set to not approved.', 'event_espresso')
55
-                ),
56
-            'primary_attendee' => array(
57
-                'label' => __('Primary Registrant', 'event_espresso'),
58
-                'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive when the registration status is not approved.', 'event_espresso')
59
-                )
60
-            );
61
-    }
51
+		$this->_contexts = array(
52
+			'admin' => array(
53
+				'label' => __('Event Admin', 'event_espresso'),
54
+				'description' => __('This template is what event administrators will receive when registration status is set to not approved.', 'event_espresso')
55
+				),
56
+			'primary_attendee' => array(
57
+				'label' => __('Primary Registrant', 'event_espresso'),
58
+				'description' => __('This template is what the primary registrant (the person who completed the initial transaction) will receive when the registration status is not approved.', 'event_espresso')
59
+				)
60
+			);
61
+	}
62 62
 
63 63
 
64 64
 
65
-    protected function _primary_attendee_addressees()
66
-    {
67
-        $cached = $this->_single_message;
68
-        $this->_single_message = false;
69
-        $addressees = parent::_primary_attendee_addressees();
70
-        $this->_single_message = $cached;
71
-        return $addressees;
72
-    }
65
+	protected function _primary_attendee_addressees()
66
+	{
67
+		$cached = $this->_single_message;
68
+		$this->_single_message = false;
69
+		$addressees = parent::_primary_attendee_addressees();
70
+		$this->_single_message = $cached;
71
+		return $addressees;
72
+	}
73 73
 }
Please login to merge, or discard this patch.