|
@@ -1,6 +1,6 @@ discard block |
|
|
block discarded – undo |
1
|
1
|
<?php |
2
|
|
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
3
|
|
- exit( 'No direct script access allowed' ); |
|
2
|
+if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3
|
+ exit('No direct script access allowed'); |
4
|
4
|
} |
5
|
5
|
/** |
6
|
6
|
* ************************************************************************ |
|
@@ -31,7 +31,7 @@ discard block |
|
|
block discarded – undo |
31
|
31
|
* @param \EE_Checkout $checkout |
32
|
32
|
* @return string |
33
|
33
|
*/ |
34
|
|
-function ee_deprecated__registration_checkout__button_text( $submit_button_text, EE_Checkout $checkout ) { |
|
34
|
+function ee_deprecated__registration_checkout__button_text($submit_button_text, EE_Checkout $checkout) { |
35
|
35
|
// list of old filters |
36
|
36
|
$deprecated_filters = array( |
37
|
37
|
'update_registration_details' => true, |
|
@@ -41,16 +41,16 @@ discard block |
|
|
block discarded – undo |
41
|
41
|
'proceed_to' => true, |
42
|
42
|
); |
43
|
43
|
// loop thru and call doing_it_wrong() or remove any that aren't being used |
44
|
|
- foreach ( $deprecated_filters as $deprecated_filter => $on ) { |
|
44
|
+ foreach ($deprecated_filters as $deprecated_filter => $on) { |
45
|
45
|
// was this filter called ? |
46
|
|
- if ( has_action( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter )) { |
|
46
|
+ if (has_action('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter)) { |
47
|
47
|
// only display doing_it_wrong() notice to Event Admins during non-AJAX requests |
48
|
|
- if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter' ) && ! defined( 'DOING_AJAX' ) ) { |
|
48
|
+ if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter') && ! defined('DOING_AJAX')) { |
49
|
49
|
EE_Error::doing_it_wrong( |
50
|
|
- 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter, |
|
50
|
+ 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter, |
51
|
51
|
sprintf( |
52
|
|
- __( 'The %1$s filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso' ), |
53
|
|
- 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter, |
|
52
|
+ __('The %1$s filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso'), |
|
53
|
+ 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter, |
54
|
54
|
'<br />', |
55
|
55
|
'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', |
56
|
56
|
'/modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php' |
|
@@ -59,24 +59,24 @@ discard block |
|
|
block discarded – undo |
59
|
59
|
); |
60
|
60
|
} |
61
|
61
|
} else { |
62
|
|
- unset( $deprecated_filters[ $deprecated_filter ] ); |
|
62
|
+ unset($deprecated_filters[$deprecated_filter]); |
63
|
63
|
} |
64
|
64
|
} |
65
|
|
- if ( ! empty( $deprecated_filters )) { |
|
65
|
+ if ( ! empty($deprecated_filters)) { |
66
|
66
|
|
67
|
|
- if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset( $deprecated_filters[ 'update_registration_details' ] )) { |
68
|
|
- $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text ); |
69
|
|
- } else if ( $checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset( $deprecated_filters[ 'process_payment' ] ) ) { |
70
|
|
- $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text ); |
71
|
|
- } else if ( $checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset( $deprecated_filters[ 'finalize_registration' ] ) ) { |
72
|
|
- $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text ); |
|
67
|
+ if ($checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset($deprecated_filters['update_registration_details'])) { |
|
68
|
+ $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text); |
|
69
|
+ } else if ($checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset($deprecated_filters['process_payment'])) { |
|
70
|
+ $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text); |
|
71
|
+ } else if ($checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset($deprecated_filters['finalize_registration'])) { |
|
72
|
+ $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text); |
73
|
73
|
} |
74
|
|
- if ( $checkout->next_step instanceof EE_SPCO_Reg_Step ) { |
75
|
|
- if ( $checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset( $deprecated_filters[ 'and_proceed_to_payment' ] ) ) { |
76
|
|
- $submit_button_text .= apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text ); |
|
74
|
+ if ($checkout->next_step instanceof EE_SPCO_Reg_Step) { |
|
75
|
+ if ($checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset($deprecated_filters['and_proceed_to_payment'])) { |
|
76
|
+ $submit_button_text .= apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text); |
77
|
77
|
} |
78
|
|
- if ( $checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset( $deprecated_filters[ 'proceed_to' ] ) ) { |
79
|
|
- $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text ) . $checkout->next_step->name(); |
|
78
|
+ if ($checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset($deprecated_filters['proceed_to'])) { |
|
79
|
+ $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text).$checkout->next_step->name(); |
80
|
80
|
} |
81
|
81
|
} |
82
|
82
|
|
|
@@ -84,7 +84,7 @@ discard block |
|
|
block discarded – undo |
84
|
84
|
return $submit_button_text; |
85
|
85
|
|
86
|
86
|
} |
87
|
|
-add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2 ); |
|
87
|
+add_filter('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2); |
88
|
88
|
|
89
|
89
|
|
90
|
90
|
|
|
@@ -95,16 +95,16 @@ discard block |
|
|
block discarded – undo |
95
|
95
|
* @param \EE_Checkout $checkout |
96
|
96
|
* @param boolean $status_updates |
97
|
97
|
*/ |
98
|
|
-function ee_deprecated_finalize_transaction( EE_Checkout $checkout, $status_updates ) { |
|
98
|
+function ee_deprecated_finalize_transaction(EE_Checkout $checkout, $status_updates) { |
99
|
99
|
$action_ref = NULL; |
100
|
|
- $action_ref = has_action( 'AHEE__EE_Transaction__finalize__new_transaction' ) ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref; |
101
|
|
- $action_ref = has_action( 'AHEE__EE_Transaction__finalize__all_transaction' ) ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref; |
102
|
|
- if ( $action_ref ) { |
|
100
|
+ $action_ref = has_action('AHEE__EE_Transaction__finalize__new_transaction') ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref; |
|
101
|
+ $action_ref = has_action('AHEE__EE_Transaction__finalize__all_transaction') ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref; |
|
102
|
+ if ($action_ref) { |
103
|
103
|
|
104
|
104
|
EE_Error::doing_it_wrong( |
105
|
105
|
$action_ref, |
106
|
106
|
sprintf( |
107
|
|
- __( 'This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso' ), |
|
107
|
+ __('This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso'), |
108
|
108
|
'<br />', |
109
|
109
|
'/core/business/EE_Transaction_Processor.class.php', |
110
|
110
|
'AHEE__EE_Transaction_Processor__finalize', |
|
@@ -114,39 +114,39 @@ discard block |
|
|
block discarded – undo |
114
|
114
|
), |
115
|
115
|
'4.6.0' |
116
|
116
|
); |
117
|
|
- switch ( $action_ref ) { |
|
117
|
+ switch ($action_ref) { |
118
|
118
|
case 'AHEE__EE_Transaction__finalize__new_transaction' : |
119
|
|
- do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request ); |
|
119
|
+ do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request); |
120
|
120
|
break; |
121
|
121
|
case 'AHEE__EE_Transaction__finalize__all_transaction' : |
122
|
|
- do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array( 'new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates ), $checkout->admin_request ); |
|
122
|
+ do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array('new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates), $checkout->admin_request); |
123
|
123
|
break; |
124
|
124
|
} |
125
|
125
|
} |
126
|
126
|
} |
127
|
|
-add_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2 ); |
|
127
|
+add_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2); |
128
|
128
|
/** |
129
|
129
|
* ee_deprecated_finalize_registration |
130
|
130
|
* |
131
|
131
|
* @param EE_Registration $registration |
132
|
132
|
*/ |
133
|
|
-function ee_deprecated_finalize_registration( EE_Registration $registration ) { |
134
|
|
- $action_ref = has_action( 'AHEE__EE_Registration__finalize__update_and_new_reg' ) ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL; |
135
|
|
- if ( $action_ref ) { |
|
133
|
+function ee_deprecated_finalize_registration(EE_Registration $registration) { |
|
134
|
+ $action_ref = has_action('AHEE__EE_Registration__finalize__update_and_new_reg') ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL; |
|
135
|
+ if ($action_ref) { |
136
|
136
|
EE_Error::doing_it_wrong( |
137
|
137
|
$action_ref, |
138
|
138
|
sprintf( |
139
|
|
- __( 'This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso' ), |
|
139
|
+ __('This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso'), |
140
|
140
|
'<br />', |
141
|
141
|
'/core/business/EE_Registration_Processor.class.php', |
142
|
142
|
'AHEE__EE_Registration_Processor__trigger_registration_status_changed_hook' |
143
|
143
|
), |
144
|
144
|
'4.6.0' |
145
|
145
|
); |
146
|
|
- do_action( 'AHEE__EE_Registration__finalize__update_and_new_reg', $registration, ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ))); |
|
146
|
+ do_action('AHEE__EE_Registration__finalize__update_and_new_reg', $registration, (is_admin() && ! (defined('DOING_AJAX') && DOING_AJAX))); |
147
|
147
|
} |
148
|
148
|
} |
149
|
|
-add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1 ); |
|
149
|
+add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1); |
150
|
150
|
|
151
|
151
|
|
152
|
152
|
|
|
@@ -154,7 +154,7 @@ discard block |
|
|
block discarded – undo |
154
|
154
|
* Called after EED_Module::set_hooks() and EED_Module::set_admin_hooks() was called. |
155
|
155
|
* Checks if any deprecated hooks were hooked-into and provide doing_it_wrong messages appropriately. |
156
|
156
|
*/ |
157
|
|
-function ee_deprecated_hooks(){ |
|
157
|
+function ee_deprecated_hooks() { |
158
|
158
|
/** |
159
|
159
|
* @var $hooks array where keys are hook names, and their values are array{ |
160
|
160
|
* @type string $version when deprecated |
|
@@ -165,25 +165,25 @@ discard block |
|
|
block discarded – undo |
165
|
165
|
$hooks = array( |
166
|
166
|
'AHEE__EE_System___do_setup_validations' => array( |
167
|
167
|
'version' => '4.6.0', |
168
|
|
- 'alternative' => __( 'Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso' ), |
|
168
|
+ 'alternative' => __('Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso'), |
169
|
169
|
'still_works' => FALSE |
170
|
170
|
) |
171
|
171
|
); |
172
|
|
- foreach( $hooks as $name => $deprecation_info ){ |
173
|
|
- if( has_action( $name ) ){ |
|
172
|
+ foreach ($hooks as $name => $deprecation_info) { |
|
173
|
+ if (has_action($name)) { |
174
|
174
|
EE_Error::doing_it_wrong( |
175
|
175
|
$name, |
176
|
176
|
sprintf( |
177
|
|
- __('This filter is deprecated. %1$s%2$s','event_espresso'), |
178
|
|
- $deprecation_info[ 'still_works' ] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __( 'It has been completely removed.', 'event_espresso' ), |
179
|
|
- isset( $deprecation_info[ 'alternative' ] ) ? $deprecation_info[ 'alternative' ] : __( 'Please read the current EE4 documentation further or contact Support.', 'event_espresso' ) |
|
177
|
+ __('This filter is deprecated. %1$s%2$s', 'event_espresso'), |
|
178
|
+ $deprecation_info['still_works'] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __('It has been completely removed.', 'event_espresso'), |
|
179
|
+ isset($deprecation_info['alternative']) ? $deprecation_info['alternative'] : __('Please read the current EE4 documentation further or contact Support.', 'event_espresso') |
180
|
180
|
), |
181
|
|
- isset( $deprecation_info[ 'version' ] ) ? $deprecation_info[ 'version' ] : __( 'recently', 'event_espresso' ) |
|
181
|
+ isset($deprecation_info['version']) ? $deprecation_info['version'] : __('recently', 'event_espresso') |
182
|
182
|
); |
183
|
183
|
} |
184
|
184
|
} |
185
|
185
|
} |
186
|
|
-add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks' ); |
|
186
|
+add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks'); |
187
|
187
|
|
188
|
188
|
|
189
|
189
|
|
|
@@ -194,9 +194,9 @@ discard block |
|
|
block discarded – undo |
194
|
194
|
* @return boolean |
195
|
195
|
*/ |
196
|
196
|
function ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() { |
197
|
|
- $in_use = has_filter( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns' ) |
198
|
|
- || has_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save' ); |
199
|
|
- if( $in_use ) { |
|
197
|
+ $in_use = has_filter('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns') |
|
198
|
+ || has_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save'); |
|
199
|
+ if ($in_use) { |
200
|
200
|
$msg = __( |
201
|
201
|
'We detected you are using the filter FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns or AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save.' |
202
|
202
|
. 'Both of these have been deprecated and should not be used anymore. You should instead use FHEE__EE_Form_Section_Proper___construct__options_array to customize the contents of the form,' |
|
@@ -205,18 +205,18 @@ discard block |
|
|
block discarded – undo |
205
|
205
|
'event_espresso' ) |
206
|
206
|
; |
207
|
207
|
EE_Error::doing_it_wrong( |
208
|
|
- __CLASS__ . '::' . __FUNCTION__, |
|
208
|
+ __CLASS__.'::'.__FUNCTION__, |
209
|
209
|
$msg, |
210
|
210
|
'4.8.32.rc.000' |
211
|
211
|
); |
212
|
212
|
//it seems the doing_it_wrong messages get output during some hidden html tags, so add an error to make sure this gets noticed |
213
|
|
- if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { |
214
|
|
- EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
213
|
+ if (is_admin() && ! defined('DOING_AJAX')) { |
|
214
|
+ EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
215
|
215
|
} |
216
|
216
|
} |
217
|
217
|
return $in_use; |
218
|
218
|
} |
219
|
|
-add_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks' ); |
|
219
|
+add_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks'); |
220
|
220
|
|
221
|
221
|
/** |
222
|
222
|
* @deprecated since 4.8.32.rc.000 because it has issues on https://events.codebasehq.com/projects/event-espresso/tickets/9165 |
|
@@ -225,34 +225,34 @@ discard block |
|
|
block discarded – undo |
225
|
225
|
* @param EE_Admin_Page $admin_page |
226
|
226
|
* @return void |
227
|
227
|
*/ |
228
|
|
-function ee_deprecated_update_attendee_registration_form_old( $admin_page ) { |
|
228
|
+function ee_deprecated_update_attendee_registration_form_old($admin_page) { |
229
|
229
|
//check if the old hooks are in use. If not, do the default |
230
|
|
- if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
231
|
|
- || ! $admin_page instanceof EE_Admin_Page ) { |
|
230
|
+ if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
231
|
+ || ! $admin_page instanceof EE_Admin_Page) { |
232
|
232
|
return; |
233
|
233
|
} |
234
|
234
|
$req_data = $admin_page->get_request_data(); |
235
|
|
- $qstns = isset( $req_data['qstn'] ) ? $req_data['qstn'] : FALSE; |
236
|
|
- $REG_ID = isset( $req_data['_REG_ID'] ) ? absint( $req_data['_REG_ID'] ) : FALSE; |
237
|
|
- $qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns ); |
238
|
|
- if ( ! $REG_ID || ! $qstns ) { |
239
|
|
- EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
235
|
+ $qstns = isset($req_data['qstn']) ? $req_data['qstn'] : FALSE; |
|
236
|
+ $REG_ID = isset($req_data['_REG_ID']) ? absint($req_data['_REG_ID']) : FALSE; |
|
237
|
+ $qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns); |
|
238
|
+ if ( ! $REG_ID || ! $qstns) { |
|
239
|
+ EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
240
|
240
|
} |
241
|
241
|
$success = TRUE; |
242
|
242
|
|
243
|
243
|
// allow others to get in on this awesome fun :D |
244
|
|
- do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns ); |
|
244
|
+ do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns); |
245
|
245
|
// loop thru questions... FINALLY!!! |
246
|
246
|
|
247
|
|
- foreach ( $qstns as $QST_ID => $qstn ) { |
|
247
|
+ foreach ($qstns as $QST_ID => $qstn) { |
248
|
248
|
//if $qstn isn't an array then it doesn't already have an answer, so let's create the answer |
249
|
|
- if ( !is_array($qstn) ) { |
250
|
|
- $success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn); |
|
249
|
+ if ( ! is_array($qstn)) { |
|
250
|
+ $success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn); |
251
|
251
|
continue; |
252
|
252
|
} |
253
|
253
|
|
254
|
254
|
|
255
|
|
- foreach ( $qstn as $ANS_ID => $ANS_value ) { |
|
255
|
+ foreach ($qstn as $ANS_ID => $ANS_value) { |
256
|
256
|
//get answer |
257
|
257
|
$query_params = array( |
258
|
258
|
0 => array( |
|
@@ -263,7 +263,7 @@ discard block |
|
|
block discarded – undo |
263
|
263
|
); |
264
|
264
|
$answer = EEM_Answer::instance()->get_one($query_params); |
265
|
265
|
//this MAY be an array but NOT have an answer because its multi select. If so then we need to create the answer |
266
|
|
- if ( ! $answer instanceof EE_Answer ) { |
|
266
|
+ if ( ! $answer instanceof EE_Answer) { |
267
|
267
|
$set_values = array( |
268
|
268
|
'QST_ID' => $QST_ID, |
269
|
269
|
'REG_ID' => $REG_ID, |
|
@@ -278,11 +278,11 @@ discard block |
|
|
block discarded – undo |
278
|
278
|
} |
279
|
279
|
} |
280
|
280
|
$what = __('Registration Form', 'event_espresso'); |
281
|
|
- $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
282
|
|
- $admin_page->redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
281
|
+ $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
282
|
+ $admin_page->redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
283
|
283
|
exit; |
284
|
284
|
} |
285
|
|
-add_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1 ); |
|
285
|
+add_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1); |
286
|
286
|
/** |
287
|
287
|
* Render the registration admin page's custom questions area in the old fashion |
288
|
288
|
* and firing the old hooks. When this method is removed, we can probably also |
|
@@ -295,31 +295,31 @@ discard block |
|
|
block discarded – undo |
295
|
295
|
* @return bool |
296
|
296
|
* @throws \EE_Error |
297
|
297
|
*/ |
298
|
|
-function ee_deprecated_reg_questions_meta_box_old( $do_default_action, $admin_page, $registration ) { |
|
298
|
+function ee_deprecated_reg_questions_meta_box_old($do_default_action, $admin_page, $registration) { |
299
|
299
|
//check if the old hooks are in use. If not, do the default |
300
|
|
- if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
301
|
|
- || ! $admin_page instanceof EE_Admin_Page ) { |
|
300
|
+ if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
301
|
+ || ! $admin_page instanceof EE_Admin_Page) { |
302
|
302
|
return $do_default_action; |
303
|
303
|
} |
304
|
|
- add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $admin_page, 'form_before_question_group' ), 10, 1 ); |
305
|
|
- add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $admin_page, 'form_after_question_group' ), 10, 1 ); |
306
|
|
- add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $admin_page, 'form_form_field_label_wrap' ), 10, 1 ); |
307
|
|
- add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $admin_page, 'form_form_field_input__wrap' ), 10, 1 ); |
|
304
|
+ add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($admin_page, 'form_before_question_group'), 10, 1); |
|
305
|
+ add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($admin_page, 'form_after_question_group'), 10, 1); |
|
306
|
+ add_filter('FHEE__EEH_Form_Fields__label_html', array($admin_page, 'form_form_field_label_wrap'), 10, 1); |
|
307
|
+ add_filter('FHEE__EEH_Form_Fields__input_html', array($admin_page, 'form_form_field_input__wrap'), 10, 1); |
308
|
308
|
|
309
|
|
- $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $registration, $registration->get('EVT_ID') ); |
|
309
|
+ $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($registration, $registration->get('EVT_ID')); |
310
|
310
|
|
311
|
|
- EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
311
|
+ EE_Registry::instance()->load_helper('Form_Fields'); |
312
|
312
|
$template_args = array( |
313
|
|
- 'att_questions' => EEH_Form_Fields::generate_question_groups_html( $question_groups ), |
|
313
|
+ 'att_questions' => EEH_Form_Fields::generate_question_groups_html($question_groups), |
314
|
314
|
'reg_questions_form_action' => 'edit_registration', |
315
|
315
|
'REG_ID' => $registration->ID() |
316
|
316
|
); |
317
|
|
- $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
318
|
|
- echo EEH_Template::display_template( $template_path, $template_args, TRUE ); |
|
317
|
+ $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
318
|
+ echo EEH_Template::display_template($template_path, $template_args, TRUE); |
319
|
319
|
//indicate that we should not do the default admin page code |
320
|
320
|
return false; |
321
|
321
|
} |
322
|
|
-add_action( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3 ); |
|
322
|
+add_action('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3); |
323
|
323
|
|
324
|
324
|
|
325
|
325
|
|
|
@@ -360,9 +360,9 @@ discard block |
|
|
block discarded – undo |
360
|
360
|
'4.9.0' |
361
|
361
|
); |
362
|
362
|
/** @var EE_Message_Resource_Manager $message_resource_manager */ |
363
|
|
- $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
364
|
|
- $messenger = $message_resource_manager->get_messenger( $messenger_name ); |
365
|
|
- $message_type = $message_resource_manager->get_message_type( $message_type_name ); |
|
363
|
+ $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
364
|
+ $messenger = $message_resource_manager->get_messenger($messenger_name); |
|
365
|
+ $message_type = $message_resource_manager->get_message_type($message_type_name); |
366
|
366
|
return EE_Registry::instance()->load_lib( |
367
|
367
|
'Messages_Template_Defaults', |
368
|
368
|
array( |
|
@@ -427,15 +427,15 @@ discard block |
|
|
block discarded – undo |
427
|
427
|
/** |
428
|
428
|
* @param string $method |
429
|
429
|
*/ |
430
|
|
- public function _class_is_deprecated( $method ) { |
|
430
|
+ public function _class_is_deprecated($method) { |
431
|
431
|
EE_Error::doing_it_wrong( |
432
|
|
- 'EE_messages::' . $method, |
433
|
|
- __( 'EE_messages has been deprecated. Please use EE_Message_Resource_Manager instead.' ), |
|
432
|
+ 'EE_messages::'.$method, |
|
433
|
+ __('EE_messages has been deprecated. Please use EE_Message_Resource_Manager instead.'), |
434
|
434
|
'4.9.0', |
435
|
435
|
'4.10.0.p' |
436
|
436
|
); |
437
|
437
|
// Please use EE_Message_Resource_Manager instead |
438
|
|
- $this->_message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
438
|
+ $this->_message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
439
|
439
|
} |
440
|
440
|
|
441
|
441
|
|
|
@@ -445,10 +445,10 @@ discard block |
|
|
block discarded – undo |
445
|
445
|
* @param string $messenger_name |
446
|
446
|
* @return boolean TRUE if it was PREVIOUSLY active, and FALSE if it was previously inactive |
447
|
447
|
*/ |
448
|
|
- public function ensure_messenger_is_active( $messenger_name ) { |
|
448
|
+ public function ensure_messenger_is_active($messenger_name) { |
449
|
449
|
// EE_messages has been deprecated |
450
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
451
|
|
- return $this->_message_resource_manager->ensure_messenger_is_active( $messenger_name ); |
|
450
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
451
|
+ return $this->_message_resource_manager->ensure_messenger_is_active($messenger_name); |
452
|
452
|
} |
453
|
453
|
|
454
|
454
|
|
|
@@ -460,10 +460,10 @@ discard block |
|
|
block discarded – undo |
460
|
460
|
* @return bool true if it got activated (or was active) and false if not. |
461
|
461
|
* @throws \EE_Error |
462
|
462
|
*/ |
463
|
|
- public function ensure_message_type_is_active( $message_type, $messenger ) { |
|
463
|
+ public function ensure_message_type_is_active($message_type, $messenger) { |
464
|
464
|
// EE_messages has been deprecated |
465
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
466
|
|
- return $this->_message_resource_manager->ensure_message_type_is_active( $message_type, $messenger ); |
|
465
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
466
|
+ return $this->_message_resource_manager->ensure_message_type_is_active($message_type, $messenger); |
467
|
467
|
} |
468
|
468
|
|
469
|
469
|
|
|
@@ -476,10 +476,10 @@ discard block |
|
|
block discarded – undo |
476
|
476
|
* they are already setup.) |
477
|
477
|
* @return boolean an array of generated templates or false if nothing generated/activated. |
478
|
478
|
*/ |
479
|
|
- public function activate_messenger( $messenger_name, $mts_to_activate = array() ) { |
|
479
|
+ public function activate_messenger($messenger_name, $mts_to_activate = array()) { |
480
|
480
|
// EE_messages has been deprecated |
481
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
482
|
|
- return $this->_message_resource_manager->activate_messenger( $messenger_name, $mts_to_activate ); |
|
481
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
482
|
+ return $this->_message_resource_manager->activate_messenger($messenger_name, $mts_to_activate); |
483
|
483
|
} |
484
|
484
|
|
485
|
485
|
|
|
@@ -491,10 +491,10 @@ discard block |
|
|
block discarded – undo |
491
|
491
|
* |
492
|
492
|
* @return bool true is a generating messenger and can be sent OR FALSE meaning cannot send. |
493
|
493
|
*/ |
494
|
|
- public function is_generating_messenger_and_active( EE_messenger $messenger, EE_message_type $message_type ) { |
|
494
|
+ public function is_generating_messenger_and_active(EE_messenger $messenger, EE_message_type $message_type) { |
495
|
495
|
// EE_messages has been deprecated |
496
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
497
|
|
- return $this->_message_resource_manager->is_generating_messenger_and_active( $messenger, $message_type ); |
|
496
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
497
|
+ return $this->_message_resource_manager->is_generating_messenger_and_active($messenger, $message_type); |
498
|
498
|
} |
499
|
499
|
|
500
|
500
|
|
|
@@ -504,10 +504,10 @@ discard block |
|
|
block discarded – undo |
504
|
504
|
* @param string $messenger |
505
|
505
|
* @return EE_messenger | null |
506
|
506
|
*/ |
507
|
|
- public function get_messenger_if_active( $messenger ) { |
|
507
|
+ public function get_messenger_if_active($messenger) { |
508
|
508
|
// EE_messages has been deprecated |
509
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
510
|
|
- return $this->_message_resource_manager->get_active_messenger( $messenger ); |
|
509
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
510
|
+ return $this->_message_resource_manager->get_active_messenger($messenger); |
511
|
511
|
} |
512
|
512
|
|
513
|
513
|
|
|
@@ -528,9 +528,9 @@ discard block |
|
|
block discarded – undo |
528
|
528
|
* 'message_type' => null |
529
|
529
|
* ) |
530
|
530
|
*/ |
531
|
|
- public function validate_for_use( EE_Message $message ) { |
|
531
|
+ public function validate_for_use(EE_Message $message) { |
532
|
532
|
// EE_messages has been deprecated |
533
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
533
|
+ $this->_class_is_deprecated(__FUNCTION__); |
534
|
534
|
return array( |
535
|
535
|
'messenger' => $message->messenger_object(), |
536
|
536
|
'message_type' => $message->message_type_object(), |
|
@@ -558,41 +558,41 @@ discard block |
|
|
block discarded – undo |
558
|
558
|
$send = true |
559
|
559
|
) { |
560
|
560
|
// EE_messages has been deprecated |
561
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
561
|
+ $this->_class_is_deprecated(__FUNCTION__); |
562
|
562
|
/** @type EE_Messages_Processor $processor */ |
563
|
|
- $processor = EE_Registry::instance()->load_lib( 'Messages_Processor' ); |
|
563
|
+ $processor = EE_Registry::instance()->load_lib('Messages_Processor'); |
564
|
564
|
$error = false; |
565
|
565
|
//try to intelligently determine what method we'll call based on the incoming data. |
566
|
566
|
//if generating and sending are different then generate and send immediately. |
567
|
|
- if ( ! empty( $sending_messenger ) && $sending_messenger != $generating_messenger && $send ) { |
|
567
|
+ if ( ! empty($sending_messenger) && $sending_messenger != $generating_messenger && $send) { |
568
|
568
|
//in the legacy system, when generating and sending were different, that means all the |
569
|
569
|
//vars are already in the request object. So let's just use that. |
570
|
570
|
try { |
571
|
571
|
/** @type EE_Message_To_Generate_From_Request $mtg */ |
572
|
|
- $mtg = EE_Registry::instance()->load_lib( 'Message_To_Generate_From_Request' ); |
573
|
|
- $processor->generate_and_send_now( $mtg ); |
574
|
|
- } catch ( EE_Error $e ) { |
|
572
|
+ $mtg = EE_Registry::instance()->load_lib('Message_To_Generate_From_Request'); |
|
573
|
+ $processor->generate_and_send_now($mtg); |
|
574
|
+ } catch (EE_Error $e) { |
575
|
575
|
$error_msg = __( |
576
|
576
|
'Please note that a system message failed to send due to a technical issue.', |
577
|
577
|
'event_espresso' |
578
|
578
|
); |
579
|
579
|
// add specific message for developers if WP_DEBUG in on |
580
|
|
- $error_msg .= '||' . $e->getMessage(); |
581
|
|
- EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
580
|
+ $error_msg .= '||'.$e->getMessage(); |
|
581
|
+ EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
582
|
582
|
$error = true; |
583
|
583
|
} |
584
|
584
|
} else { |
585
|
|
- $processor->generate_for_all_active_messengers( $type, $vars, $send ); |
|
585
|
+ $processor->generate_for_all_active_messengers($type, $vars, $send); |
586
|
586
|
//let's find out if there were any errors and how many successfully were queued. |
587
|
587
|
$count_errors = $processor->get_queue()->count_STS_in_queue( |
588
|
|
- array( EEM_Message::status_failed, EEM_Message::status_debug_only ) |
|
588
|
+ array(EEM_Message::status_failed, EEM_Message::status_debug_only) |
589
|
589
|
); |
590
|
|
- $count_queued = $processor->get_queue()->count_STS_in_queue( EEM_Message::status_incomplete ); |
591
|
|
- $count_retry = $processor->get_queue()->count_STS_in_queue( EEM_Message::status_retry ); |
|
590
|
+ $count_queued = $processor->get_queue()->count_STS_in_queue(EEM_Message::status_incomplete); |
|
591
|
+ $count_retry = $processor->get_queue()->count_STS_in_queue(EEM_Message::status_retry); |
592
|
592
|
$count_errors = $count_errors + $count_retry; |
593
|
|
- if ( $count_errors > 0 ) { |
|
593
|
+ if ($count_errors > 0) { |
594
|
594
|
$error = true; |
595
|
|
- if ( $count_errors > 1 && $count_retry > 1 && $count_queued > 1 ) { |
|
595
|
+ if ($count_errors > 1 && $count_retry > 1 && $count_queued > 1) { |
596
|
596
|
$message = sprintf( |
597
|
597
|
__( |
598
|
598
|
'There were %d errors and %d messages successfully queued for generation and sending', |
|
@@ -601,7 +601,7 @@ discard block |
|
|
block discarded – undo |
601
|
601
|
$count_errors, |
602
|
602
|
$count_queued |
603
|
603
|
); |
604
|
|
- } elseif ( $count_errors > 1 && $count_queued === 1 ) { |
|
604
|
+ } elseif ($count_errors > 1 && $count_queued === 1) { |
605
|
605
|
$message = sprintf( |
606
|
606
|
__( |
607
|
607
|
'There were %d errors and %d message successfully queued for generation.', |
|
@@ -610,7 +610,7 @@ discard block |
|
|
block discarded – undo |
610
|
610
|
$count_errors, |
611
|
611
|
$count_queued |
612
|
612
|
); |
613
|
|
- } elseif ( $count_errors === 1 && $count_queued > 1 ) { |
|
613
|
+ } elseif ($count_errors === 1 && $count_queued > 1) { |
614
|
614
|
$message = sprintf( |
615
|
615
|
__( |
616
|
616
|
'There was %d error and %d messages successfully queued for generation.', |
|
@@ -628,9 +628,9 @@ discard block |
|
|
block discarded – undo |
628
|
628
|
$count_errors |
629
|
629
|
); |
630
|
630
|
} |
631
|
|
- EE_Error::add_error( $message, __FILE__, __FUNCTION__, __LINE__ ); |
|
631
|
+ EE_Error::add_error($message, __FILE__, __FUNCTION__, __LINE__); |
632
|
632
|
} else { |
633
|
|
- if ( $count_queued === 1 ) { |
|
633
|
+ if ($count_queued === 1) { |
634
|
634
|
$message = sprintf( |
635
|
635
|
__( |
636
|
636
|
'%d message successfully queued for generation.', |
|
@@ -647,18 +647,18 @@ discard block |
|
|
block discarded – undo |
647
|
647
|
$count_queued |
648
|
648
|
); |
649
|
649
|
} |
650
|
|
- EE_Error::add_success( $message ); |
|
650
|
+ EE_Error::add_success($message); |
651
|
651
|
} |
652
|
652
|
} |
653
|
653
|
//if no error then return the generated message(s). |
654
|
|
- if ( ! $error && ! $send ) { |
655
|
|
- $generated_queue = $processor->generate_queue( false ); |
|
654
|
+ if ( ! $error && ! $send) { |
|
655
|
+ $generated_queue = $processor->generate_queue(false); |
656
|
656
|
//get message and return. |
657
|
657
|
$generated_queue->get_message_repository()->rewind(); |
658
|
658
|
$messages = array(); |
659
|
|
- while ( $generated_queue->get_message_repository()->valid() ) { |
|
659
|
+ while ($generated_queue->get_message_repository()->valid()) { |
660
|
660
|
$message = $generated_queue->get_message_repository()->current(); |
661
|
|
- if ( $message instanceof EE_Message ) { |
|
661
|
+ if ($message instanceof EE_Message) { |
662
|
662
|
//set properties that might be expected by add-ons (backward compat) |
663
|
663
|
$message->content = $message->content(); |
664
|
664
|
$message->template_pack = $message->get_template_pack(); |
|
@@ -683,10 +683,10 @@ discard block |
|
|
block discarded – undo |
683
|
683
|
* @param bool $send true we will do a test send using the messenger delivery, false we just do a regular preview |
684
|
684
|
* @return string The body of the message. |
685
|
685
|
*/ |
686
|
|
- public function preview_message( $type, $context, $messenger, $send = false ) { |
|
686
|
+ public function preview_message($type, $context, $messenger, $send = false) { |
687
|
687
|
// EE_messages has been deprecated |
688
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
689
|
|
- return EED_Messages::preview_message( $type, $context, $messenger, $send ); |
|
688
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
689
|
+ return EED_Messages::preview_message($type, $context, $messenger, $send); |
690
|
690
|
} |
691
|
691
|
|
692
|
692
|
|
|
@@ -700,14 +700,14 @@ discard block |
|
|
block discarded – undo |
700
|
700
|
* |
701
|
701
|
* @return bool success or fail. |
702
|
702
|
*/ |
703
|
|
- public function send_message_with_messenger_only( $messenger, $message_type, $message ) { |
|
703
|
+ public function send_message_with_messenger_only($messenger, $message_type, $message) { |
704
|
704
|
// EE_messages has been deprecated |
705
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
705
|
+ $this->_class_is_deprecated(__FUNCTION__); |
706
|
706
|
//setup for sending to new method. |
707
|
707
|
/** @type EE_Messages_Queue $queue */ |
708
|
|
- $queue = EE_Registry::instance()->load_lib( 'Messages_Queue' ); |
|
708
|
+ $queue = EE_Registry::instance()->load_lib('Messages_Queue'); |
709
|
709
|
//make sure we have a proper message object |
710
|
|
- if ( ! $message instanceof EE_Message && is_object( $message ) && isset( $message->content ) ) { |
|
710
|
+ if ( ! $message instanceof EE_Message && is_object($message) && isset($message->content)) { |
711
|
711
|
$msg = EE_Message_Factory::create( |
712
|
712
|
array( |
713
|
713
|
'MSG_messenger' => $messenger, |
|
@@ -719,15 +719,15 @@ discard block |
|
|
block discarded – undo |
719
|
719
|
} else { |
720
|
720
|
$msg = $message; |
721
|
721
|
} |
722
|
|
- if ( ! $msg instanceof EE_Message ) { |
|
722
|
+ if ( ! $msg instanceof EE_Message) { |
723
|
723
|
return false; |
724
|
724
|
} |
725
|
725
|
//make sure any content in a content property (if not empty) is set on the MSG_content. |
726
|
|
- if ( ! empty( $msg->content ) ) { |
727
|
|
- $msg->set( 'MSG_content', $msg->content ); |
|
726
|
+ if ( ! empty($msg->content)) { |
|
727
|
+ $msg->set('MSG_content', $msg->content); |
728
|
728
|
} |
729
|
|
- $queue->add( $msg ); |
730
|
|
- return EED_Messages::send_message_with_messenger_only( $messenger, $message_type, $queue ); |
|
729
|
+ $queue->add($msg); |
|
730
|
+ return EED_Messages::send_message_with_messenger_only($messenger, $message_type, $queue); |
731
|
731
|
} |
732
|
732
|
|
733
|
733
|
|
|
@@ -741,11 +741,11 @@ discard block |
|
|
block discarded – undo |
741
|
741
|
* @return array|object if creation is successful then we return an array of info, otherwise an error_object is returned. |
742
|
742
|
* @throws \EE_Error |
743
|
743
|
*/ |
744
|
|
- public function create_new_templates( $messenger, $message_type, $GRP_ID = 0, $is_global = false ) { |
|
744
|
+ public function create_new_templates($messenger, $message_type, $GRP_ID = 0, $is_global = false) { |
745
|
745
|
// EE_messages has been deprecated |
746
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
747
|
|
- EE_Registry::instance()->load_helper( 'MSG_Template' ); |
748
|
|
- return EEH_MSG_Template::create_new_templates( $messenger, $message_type, $GRP_ID, $is_global ); |
|
746
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
747
|
+ EE_Registry::instance()->load_helper('MSG_Template'); |
|
748
|
+ return EEH_MSG_Template::create_new_templates($messenger, $message_type, $GRP_ID, $is_global); |
749
|
749
|
} |
750
|
750
|
|
751
|
751
|
|
|
@@ -756,11 +756,11 @@ discard block |
|
|
block discarded – undo |
756
|
756
|
* @param string $message_type_name name of EE_message_type |
757
|
757
|
* @return array |
758
|
758
|
*/ |
759
|
|
- public function get_fields( $messenger_name, $message_type_name ) { |
|
759
|
+ public function get_fields($messenger_name, $message_type_name) { |
760
|
760
|
// EE_messages has been deprecated |
761
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
762
|
|
- EE_Registry::instance()->load_helper( 'MSG_Template' ); |
763
|
|
- return EEH_MSG_Template::get_fields( $messenger_name, $message_type_name ); |
|
761
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
762
|
+ EE_Registry::instance()->load_helper('MSG_Template'); |
|
763
|
+ return EEH_MSG_Template::get_fields($messenger_name, $message_type_name); |
764
|
764
|
} |
765
|
765
|
|
766
|
766
|
|
|
@@ -774,13 +774,13 @@ discard block |
|
|
block discarded – undo |
774
|
774
|
* @return array multidimensional array of messenger and message_type objects |
775
|
775
|
* (messengers index, and message_type index); |
776
|
776
|
*/ |
777
|
|
- public function get_installed( $type = 'all', $skip_cache = false ) { |
|
777
|
+ public function get_installed($type = 'all', $skip_cache = false) { |
778
|
778
|
// EE_messages has been deprecated |
779
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
780
|
|
- if ( $skip_cache ) { |
|
779
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
780
|
+ if ($skip_cache) { |
781
|
781
|
$this->_message_resource_manager->reset_active_messengers_and_message_types(); |
782
|
782
|
} |
783
|
|
- switch ( $type ) { |
|
783
|
+ switch ($type) { |
784
|
784
|
case 'messengers' : |
785
|
785
|
return array( |
786
|
786
|
'messenger' => $this->_message_resource_manager->installed_messengers(), |
|
@@ -809,7 +809,7 @@ discard block |
|
|
block discarded – undo |
809
|
809
|
*/ |
810
|
810
|
public function get_active_messengers() { |
811
|
811
|
// EE_messages has been deprecated |
812
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
812
|
+ $this->_class_is_deprecated(__FUNCTION__); |
813
|
813
|
return $this->_message_resource_manager->active_messengers(); |
814
|
814
|
} |
815
|
815
|
|
|
@@ -821,7 +821,7 @@ discard block |
|
|
block discarded – undo |
821
|
821
|
*/ |
822
|
822
|
public function get_active_message_types() { |
823
|
823
|
// EE_messages has been deprecated |
824
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
824
|
+ $this->_class_is_deprecated(__FUNCTION__); |
825
|
825
|
return $this->_message_resource_manager->list_of_active_message_types(); |
826
|
826
|
} |
827
|
827
|
|
|
@@ -833,7 +833,7 @@ discard block |
|
|
block discarded – undo |
833
|
833
|
*/ |
834
|
834
|
public function get_active_message_type_objects() { |
835
|
835
|
// EE_messages has been deprecated |
836
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
836
|
+ $this->_class_is_deprecated(__FUNCTION__); |
837
|
837
|
return $this->_message_resource_manager->get_active_message_type_objects(); |
838
|
838
|
} |
839
|
839
|
|
|
@@ -845,10 +845,10 @@ discard block |
|
|
block discarded – undo |
845
|
845
|
* @param string $messenger The messenger being checked |
846
|
846
|
* @return EE_message_type[] (or empty array if none present) |
847
|
847
|
*/ |
848
|
|
- public function get_active_message_types_per_messenger( $messenger ) { |
|
848
|
+ public function get_active_message_types_per_messenger($messenger) { |
849
|
849
|
// EE_messages has been deprecated |
850
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
851
|
|
- return $this->_message_resource_manager->get_active_message_types_for_messenger( $messenger ); |
|
850
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
851
|
+ return $this->_message_resource_manager->get_active_message_types_for_messenger($messenger); |
852
|
852
|
} |
853
|
853
|
|
854
|
854
|
|
|
@@ -859,10 +859,10 @@ discard block |
|
|
block discarded – undo |
859
|
859
|
* @param string $message_type The string should correspond to a message type. |
860
|
860
|
* @return EE_message_type|null |
861
|
861
|
*/ |
862
|
|
- public function get_active_message_type( $messenger, $message_type ) { |
|
862
|
+ public function get_active_message_type($messenger, $message_type) { |
863
|
863
|
// EE_messages has been deprecated |
864
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
865
|
|
- return $this->_message_resource_manager->get_active_message_type_for_messenger( $messenger, $message_type ); |
|
864
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
865
|
+ return $this->_message_resource_manager->get_active_message_type_for_messenger($messenger, $message_type); |
866
|
866
|
} |
867
|
867
|
|
868
|
868
|
|
|
@@ -873,7 +873,7 @@ discard block |
|
|
block discarded – undo |
873
|
873
|
*/ |
874
|
874
|
public function get_installed_message_types() { |
875
|
875
|
// EE_messages has been deprecated |
876
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
876
|
+ $this->_class_is_deprecated(__FUNCTION__); |
877
|
877
|
return $this->_message_resource_manager->installed_message_types(); |
878
|
878
|
} |
879
|
879
|
|
|
@@ -885,7 +885,7 @@ discard block |
|
|
block discarded – undo |
885
|
885
|
*/ |
886
|
886
|
public function get_installed_messengers() { |
887
|
887
|
// EE_messages has been deprecated |
888
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
|
888
|
+ $this->_class_is_deprecated(__FUNCTION__); |
889
|
889
|
return $this->_message_resource_manager->installed_messengers(); |
890
|
890
|
} |
891
|
891
|
|
|
@@ -896,10 +896,10 @@ discard block |
|
|
block discarded – undo |
896
|
896
|
* @param bool $slugs_only Whether to return an array of just slugs and labels (true) or all contexts indexed by message type. |
897
|
897
|
* @return array |
898
|
898
|
*/ |
899
|
|
- public function get_all_contexts( $slugs_only = true ) { |
|
899
|
+ public function get_all_contexts($slugs_only = true) { |
900
|
900
|
// EE_messages has been deprecated |
901
|
|
- $this->_class_is_deprecated( __FUNCTION__ ); |
902
|
|
- return $this->_message_resource_manager->get_all_contexts( $slugs_only ); |
|
901
|
+ $this->_class_is_deprecated(__FUNCTION__); |
|
902
|
+ return $this->_message_resource_manager->get_all_contexts($slugs_only); |
903
|
903
|
} |
904
|
904
|
|
905
|
905
|
|