@@ -28,112 +28,112 @@ |
||
28 | 28 | class PrivacySettingsFormHandler extends FormHandler |
29 | 29 | { |
30 | 30 | |
31 | - /** |
|
32 | - * @var EE_Config |
|
33 | - */ |
|
34 | - protected $config; |
|
31 | + /** |
|
32 | + * @var EE_Config |
|
33 | + */ |
|
34 | + protected $config; |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * PrivacySettingsFormHandler constructor. |
|
39 | - * |
|
40 | - * @param EE_Registry $registry |
|
41 | - * @param EE_Config $config |
|
42 | - */ |
|
43 | - public function __construct(EE_Registry $registry, EE_Config $config) |
|
44 | - { |
|
45 | - $this->config = $config; |
|
46 | - parent::__construct( |
|
47 | - esc_html__('Privacy Settings', 'event_espresso'), |
|
48 | - esc_html__('Privacy Settings', 'event_espresso'), |
|
49 | - 'privacy-settings', |
|
50 | - '', |
|
51 | - FormHandler::DO_NOT_SETUP_FORM, |
|
52 | - $registry |
|
53 | - ); |
|
54 | - } |
|
37 | + /** |
|
38 | + * PrivacySettingsFormHandler constructor. |
|
39 | + * |
|
40 | + * @param EE_Registry $registry |
|
41 | + * @param EE_Config $config |
|
42 | + */ |
|
43 | + public function __construct(EE_Registry $registry, EE_Config $config) |
|
44 | + { |
|
45 | + $this->config = $config; |
|
46 | + parent::__construct( |
|
47 | + esc_html__('Privacy Settings', 'event_espresso'), |
|
48 | + esc_html__('Privacy Settings', 'event_espresso'), |
|
49 | + 'privacy-settings', |
|
50 | + '', |
|
51 | + FormHandler::DO_NOT_SETUP_FORM, |
|
52 | + $registry |
|
53 | + ); |
|
54 | + } |
|
55 | 55 | |
56 | 56 | |
57 | - /** |
|
58 | - * creates and returns the actual form |
|
59 | - * |
|
60 | - * @return EE_Form_Section_Proper |
|
61 | - */ |
|
62 | - public function generate() |
|
63 | - { |
|
64 | - // this form makes use of the session for passing around invalid form submission data, so make sure its enabled |
|
65 | - add_filter('FHEE__EE_Session___save_session_to_db__abort_session_save', '__return_false'); |
|
66 | - /** |
|
67 | - * @var $reg_config EE_Registration_Config |
|
68 | - */ |
|
69 | - $reg_config = $this->config->registration; |
|
70 | - return new EE_Form_Section_Proper( |
|
71 | - array( |
|
72 | - 'name' => 'privacy_consent_settings', |
|
73 | - 'subsections' => array( |
|
74 | - 'privacy_consent_form_hdr' => new EE_Form_Section_HTML( |
|
75 | - EEH_HTML::h2(esc_html__('Privacy Policy Consent Settings', 'event_espresso')) |
|
76 | - ), |
|
77 | - 'enable' => new EE_Select_Reveal_Input( |
|
78 | - array( |
|
79 | - 'enable-privacy-consent' => esc_html__('Enabled', 'event_espresso'), |
|
80 | - 'disable' => esc_html__('Disabled', 'event_espresso'), |
|
81 | - ), |
|
82 | - array( |
|
83 | - 'default' => $reg_config->isConsentCheckboxEnabled() |
|
84 | - ? 'enable-privacy-consent' |
|
85 | - : 'disable', |
|
86 | - 'html_label_text' => esc_html__('Privacy Consent Checkbox', 'event_espresso'), |
|
87 | - 'html_help_text' => esc_html__( |
|
88 | - 'When enabled, a checkbox appears in the registration form requiring users to consent to your site\'s privacy policy.', |
|
89 | - 'event_espresso' |
|
90 | - ), |
|
91 | - ) |
|
92 | - ), |
|
93 | - 'enable-privacy-consent' => new EE_Form_Section_Proper( |
|
94 | - array( |
|
95 | - 'subsections' => array( |
|
96 | - 'consent_assertion' => new EE_Text_Area_Input( |
|
97 | - array( |
|
98 | - 'default' => $reg_config->getConsentCheckboxLabelText(), |
|
99 | - 'html_label_text' => esc_html__('Consent Text', 'event_espresso'), |
|
100 | - 'html_help_text' => esc_html__( |
|
101 | - 'Text describing what the registrant is consenting to by submitting their personal data in the registration form. To reset to default value, remove all this text and save.', |
|
102 | - 'event_espresso' |
|
103 | - ), |
|
104 | - 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
105 | - ) |
|
106 | - ), |
|
107 | - ), |
|
108 | - ) |
|
109 | - ), |
|
110 | - ), |
|
111 | - ) |
|
112 | - ); |
|
113 | - } |
|
57 | + /** |
|
58 | + * creates and returns the actual form |
|
59 | + * |
|
60 | + * @return EE_Form_Section_Proper |
|
61 | + */ |
|
62 | + public function generate() |
|
63 | + { |
|
64 | + // this form makes use of the session for passing around invalid form submission data, so make sure its enabled |
|
65 | + add_filter('FHEE__EE_Session___save_session_to_db__abort_session_save', '__return_false'); |
|
66 | + /** |
|
67 | + * @var $reg_config EE_Registration_Config |
|
68 | + */ |
|
69 | + $reg_config = $this->config->registration; |
|
70 | + return new EE_Form_Section_Proper( |
|
71 | + array( |
|
72 | + 'name' => 'privacy_consent_settings', |
|
73 | + 'subsections' => array( |
|
74 | + 'privacy_consent_form_hdr' => new EE_Form_Section_HTML( |
|
75 | + EEH_HTML::h2(esc_html__('Privacy Policy Consent Settings', 'event_espresso')) |
|
76 | + ), |
|
77 | + 'enable' => new EE_Select_Reveal_Input( |
|
78 | + array( |
|
79 | + 'enable-privacy-consent' => esc_html__('Enabled', 'event_espresso'), |
|
80 | + 'disable' => esc_html__('Disabled', 'event_espresso'), |
|
81 | + ), |
|
82 | + array( |
|
83 | + 'default' => $reg_config->isConsentCheckboxEnabled() |
|
84 | + ? 'enable-privacy-consent' |
|
85 | + : 'disable', |
|
86 | + 'html_label_text' => esc_html__('Privacy Consent Checkbox', 'event_espresso'), |
|
87 | + 'html_help_text' => esc_html__( |
|
88 | + 'When enabled, a checkbox appears in the registration form requiring users to consent to your site\'s privacy policy.', |
|
89 | + 'event_espresso' |
|
90 | + ), |
|
91 | + ) |
|
92 | + ), |
|
93 | + 'enable-privacy-consent' => new EE_Form_Section_Proper( |
|
94 | + array( |
|
95 | + 'subsections' => array( |
|
96 | + 'consent_assertion' => new EE_Text_Area_Input( |
|
97 | + array( |
|
98 | + 'default' => $reg_config->getConsentCheckboxLabelText(), |
|
99 | + 'html_label_text' => esc_html__('Consent Text', 'event_espresso'), |
|
100 | + 'html_help_text' => esc_html__( |
|
101 | + 'Text describing what the registrant is consenting to by submitting their personal data in the registration form. To reset to default value, remove all this text and save.', |
|
102 | + 'event_espresso' |
|
103 | + ), |
|
104 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
105 | + ) |
|
106 | + ), |
|
107 | + ), |
|
108 | + ) |
|
109 | + ), |
|
110 | + ), |
|
111 | + ) |
|
112 | + ); |
|
113 | + } |
|
114 | 114 | |
115 | 115 | |
116 | - /** |
|
117 | - * After validating the form data, update the registration config |
|
118 | - * |
|
119 | - * @param array $submitted_form_data |
|
120 | - * @return bool |
|
121 | - */ |
|
122 | - public function process($submitted_form_data = array()) |
|
123 | - { |
|
124 | - try { |
|
125 | - $valid_data = parent::process($submitted_form_data); |
|
126 | - $reg_config = $this->config->registration; |
|
127 | - $reg_config->setConsentCheckboxEnabled($valid_data['enable'] === 'enable-privacy-consent'); |
|
128 | - $reg_config->setConsentCheckboxLabelText( |
|
129 | - $valid_data['enable-privacy-consent']['consent_assertion'] |
|
130 | - ); |
|
131 | - return $this->config->update_espresso_config(false, false); |
|
132 | - } catch (InvalidFormSubmissionException $e) { |
|
133 | - // the form was invalid, it should be re-displayed with errors |
|
134 | - return false; |
|
135 | - } |
|
136 | - } |
|
116 | + /** |
|
117 | + * After validating the form data, update the registration config |
|
118 | + * |
|
119 | + * @param array $submitted_form_data |
|
120 | + * @return bool |
|
121 | + */ |
|
122 | + public function process($submitted_form_data = array()) |
|
123 | + { |
|
124 | + try { |
|
125 | + $valid_data = parent::process($submitted_form_data); |
|
126 | + $reg_config = $this->config->registration; |
|
127 | + $reg_config->setConsentCheckboxEnabled($valid_data['enable'] === 'enable-privacy-consent'); |
|
128 | + $reg_config->setConsentCheckboxLabelText( |
|
129 | + $valid_data['enable-privacy-consent']['consent_assertion'] |
|
130 | + ); |
|
131 | + return $this->config->update_espresso_config(false, false); |
|
132 | + } catch (InvalidFormSubmissionException $e) { |
|
133 | + // the form was invalid, it should be re-displayed with errors |
|
134 | + return false; |
|
135 | + } |
|
136 | + } |
|
137 | 137 | } |
138 | 138 | // End of file PrivacySettingsFormHandler.php |
139 | 139 | // Location: EventEspresso\core\domain\services\admin\privacy\forms/PrivacySettingsFormHandler.php |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | $this->organization_config->instagram = isset($form_data['organization_instagram']) |
448 | 448 | ? esc_url_raw($form_data['organization_instagram']) |
449 | 449 | : $this->organization_config->instagram; |
450 | - $this->core_config->ee_ueip_optin = isset($form_data[ EE_Core_Config::OPTION_NAME_UXIP ][0]) |
|
451 | - ? filter_var($form_data[ EE_Core_Config::OPTION_NAME_UXIP ][0], FILTER_VALIDATE_BOOLEAN) |
|
450 | + $this->core_config->ee_ueip_optin = isset($form_data[EE_Core_Config::OPTION_NAME_UXIP][0]) |
|
451 | + ? filter_var($form_data[EE_Core_Config::OPTION_NAME_UXIP][0], FILTER_VALIDATE_BOOLEAN) |
|
452 | 452 | : false; |
453 | 453 | $this->core_config->ee_ueip_has_notified = true; |
454 | 454 | |
@@ -479,10 +479,10 @@ discard block |
||
479 | 479 | if (empty($this->network_core_config->site_license_key)) { |
480 | 480 | return false; |
481 | 481 | } |
482 | - $ver_option_key = 'puvererr_' . basename(EE_PLUGIN_BASENAME); |
|
482 | + $ver_option_key = 'puvererr_'.basename(EE_PLUGIN_BASENAME); |
|
483 | 483 | $verify_fail = get_option($ver_option_key, false); |
484 | 484 | return $verify_fail === false |
485 | - || (! empty($this->network_core_config->site_license_key) |
|
485 | + || ( ! empty($this->network_core_config->site_license_key) |
|
486 | 486 | && $verify_fail === false |
487 | 487 | ); |
488 | 488 | } |
@@ -528,6 +528,6 @@ discard block |
||
528 | 528 | private function getValidationIndicator() |
529 | 529 | { |
530 | 530 | $verified_class = $this->licenseKeyVerified() ? 'ee-icon-color-ee-green' : 'ee-icon-color-ee-red'; |
531 | - return '<span class="dashicons dashicons-admin-network ' . $verified_class . ' ee-icon-size-20"></span>'; |
|
531 | + return '<span class="dashicons dashicons-admin-network '.$verified_class.' ee-icon-size-20"></span>'; |
|
532 | 532 | } |
533 | 533 | } |
@@ -44,531 +44,531 @@ |
||
44 | 44 | class OrganizationSettings extends FormHandler |
45 | 45 | { |
46 | 46 | |
47 | - /** |
|
48 | - * @var EE_Organization_Config |
|
49 | - */ |
|
50 | - protected $organization_config; |
|
47 | + /** |
|
48 | + * @var EE_Organization_Config |
|
49 | + */ |
|
50 | + protected $organization_config; |
|
51 | 51 | |
52 | - /** |
|
53 | - * @var EE_Core_Config |
|
54 | - */ |
|
55 | - protected $core_config; |
|
52 | + /** |
|
53 | + * @var EE_Core_Config |
|
54 | + */ |
|
55 | + protected $core_config; |
|
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * @var EE_Network_Core_Config |
|
60 | - */ |
|
61 | - protected $network_core_config; |
|
58 | + /** |
|
59 | + * @var EE_Network_Core_Config |
|
60 | + */ |
|
61 | + protected $network_core_config; |
|
62 | 62 | |
63 | - /** |
|
64 | - * @var CountrySubRegionDao $countrySubRegionDao |
|
65 | - */ |
|
66 | - protected $countrySubRegionDao; |
|
63 | + /** |
|
64 | + * @var CountrySubRegionDao $countrySubRegionDao |
|
65 | + */ |
|
66 | + protected $countrySubRegionDao; |
|
67 | 67 | |
68 | - /** |
|
69 | - * Form constructor. |
|
70 | - * |
|
71 | - * @param EE_Registry $registry |
|
72 | - * @param EE_Organization_Config $organization_config |
|
73 | - * @param EE_Core_Config $core_config |
|
74 | - * @param EE_Network_Core_Config $network_core_config |
|
75 | - * @param CountrySubRegionDao $countrySubRegionDao |
|
76 | - * @throws InvalidArgumentException |
|
77 | - * @throws InvalidDataTypeException |
|
78 | - * @throws DomainException |
|
79 | - */ |
|
80 | - public function __construct( |
|
81 | - EE_Registry $registry, |
|
82 | - EE_Organization_Config $organization_config, |
|
83 | - EE_Core_Config $core_config, |
|
84 | - EE_Network_Core_Config $network_core_config, |
|
85 | - CountrySubRegionDao $countrySubRegionDao |
|
86 | - ) { |
|
87 | - $this->organization_config = $organization_config; |
|
88 | - $this->core_config = $core_config; |
|
89 | - $this->network_core_config = $network_core_config; |
|
90 | - $this->countrySubRegionDao = $countrySubRegionDao; |
|
91 | - parent::__construct( |
|
92 | - esc_html__('Your Organization Settings', 'event_espresso'), |
|
93 | - esc_html__('Your Organization Settings', 'event_espresso'), |
|
94 | - 'organization_settings', |
|
95 | - '', |
|
96 | - FormHandler::DO_NOT_SETUP_FORM, |
|
97 | - $registry |
|
98 | - ); |
|
99 | - } |
|
68 | + /** |
|
69 | + * Form constructor. |
|
70 | + * |
|
71 | + * @param EE_Registry $registry |
|
72 | + * @param EE_Organization_Config $organization_config |
|
73 | + * @param EE_Core_Config $core_config |
|
74 | + * @param EE_Network_Core_Config $network_core_config |
|
75 | + * @param CountrySubRegionDao $countrySubRegionDao |
|
76 | + * @throws InvalidArgumentException |
|
77 | + * @throws InvalidDataTypeException |
|
78 | + * @throws DomainException |
|
79 | + */ |
|
80 | + public function __construct( |
|
81 | + EE_Registry $registry, |
|
82 | + EE_Organization_Config $organization_config, |
|
83 | + EE_Core_Config $core_config, |
|
84 | + EE_Network_Core_Config $network_core_config, |
|
85 | + CountrySubRegionDao $countrySubRegionDao |
|
86 | + ) { |
|
87 | + $this->organization_config = $organization_config; |
|
88 | + $this->core_config = $core_config; |
|
89 | + $this->network_core_config = $network_core_config; |
|
90 | + $this->countrySubRegionDao = $countrySubRegionDao; |
|
91 | + parent::__construct( |
|
92 | + esc_html__('Your Organization Settings', 'event_espresso'), |
|
93 | + esc_html__('Your Organization Settings', 'event_espresso'), |
|
94 | + 'organization_settings', |
|
95 | + '', |
|
96 | + FormHandler::DO_NOT_SETUP_FORM, |
|
97 | + $registry |
|
98 | + ); |
|
99 | + } |
|
100 | 100 | |
101 | 101 | |
102 | - /** |
|
103 | - * creates and returns the actual form |
|
104 | - * |
|
105 | - * @return EE_Form_Section_Proper |
|
106 | - * @throws EE_Error |
|
107 | - * @throws InvalidArgumentException |
|
108 | - * @throws InvalidDataTypeException |
|
109 | - * @throws InvalidInterfaceException |
|
110 | - * @throws ReflectionException |
|
111 | - */ |
|
112 | - public function generate() |
|
113 | - { |
|
114 | - $has_sub_regions = EEM_State::instance()->count( |
|
115 | - array(array('Country.CNT_ISO' => $this->organization_config->CNT_ISO)) |
|
116 | - ); |
|
117 | - $form = new EE_Form_Section_Proper( |
|
118 | - array( |
|
119 | - 'name' => 'organization_settings', |
|
120 | - 'html_id' => 'organization_settings', |
|
121 | - 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
122 | - 'subsections' => array( |
|
123 | - 'contact_information_hdr' => new EE_Form_Section_HTML( |
|
124 | - EEH_HTML::h2( |
|
125 | - esc_html__('Contact Information', 'event_espresso') |
|
126 | - . ' ' |
|
127 | - . EEH_HTML::span(EEH_Template::get_help_tab_link('contact_info_info')), |
|
128 | - '', |
|
129 | - 'contact-information-hdr' |
|
130 | - ) |
|
131 | - ), |
|
132 | - 'organization_name' => new EE_Text_Input( |
|
133 | - array( |
|
134 | - 'html_name' => 'organization_name', |
|
135 | - 'html_label_text' => esc_html__('Organization Name', 'event_espresso'), |
|
136 | - 'html_help_text' => esc_html__( |
|
137 | - 'Displayed on all emails and invoices.', |
|
138 | - 'event_espresso' |
|
139 | - ), |
|
140 | - 'default' => $this->organization_config->get_pretty('name'), |
|
141 | - 'required' => false, |
|
142 | - ) |
|
143 | - ), |
|
144 | - 'organization_address_1' => new EE_Text_Input( |
|
145 | - array( |
|
146 | - 'html_name' => 'organization_address_1', |
|
147 | - 'html_label_text' => esc_html__('Street Address', 'event_espresso'), |
|
148 | - 'default' => $this->organization_config->get_pretty('address_1'), |
|
149 | - 'required' => false, |
|
150 | - ) |
|
151 | - ), |
|
152 | - 'organization_address_2' => new EE_Text_Input( |
|
153 | - array( |
|
154 | - 'html_name' => 'organization_address_2', |
|
155 | - 'html_label_text' => esc_html__('Street Address 2', 'event_espresso'), |
|
156 | - 'default' => $this->organization_config->get_pretty('address_2'), |
|
157 | - 'required' => false, |
|
158 | - ) |
|
159 | - ), |
|
160 | - 'organization_city' => new EE_Text_Input( |
|
161 | - array( |
|
162 | - 'html_name' => 'organization_city', |
|
163 | - 'html_label_text' => esc_html__('City', 'event_espresso'), |
|
164 | - 'default' => $this->organization_config->get_pretty('city'), |
|
165 | - 'required' => false, |
|
166 | - ) |
|
167 | - ), |
|
168 | - 'organization_country' => new EE_Country_Select_Input( |
|
169 | - null, |
|
170 | - array( |
|
171 | - EE_Country_Select_Input::OPTION_GET_KEY => EE_Country_Select_Input::OPTION_GET_ALL, |
|
172 | - 'html_name' => 'organization_country', |
|
173 | - 'html_label_text' => esc_html__('Country', 'event_espresso'), |
|
174 | - 'default' => $this->organization_config->CNT_ISO, |
|
175 | - 'required' => false, |
|
176 | - 'html_help_text' => sprintf( |
|
177 | - esc_html__( |
|
178 | - '%1$sThe Country set here will have the effect of setting the currency used for all ticket prices.%2$s', |
|
179 | - 'event_espresso' |
|
180 | - ), |
|
181 | - '<span class="reminder-spn">', |
|
182 | - '</span>' |
|
183 | - ), |
|
184 | - ) |
|
185 | - ), |
|
186 | - 'organization_state' => new EE_State_Select_Input( |
|
187 | - null, |
|
188 | - array( |
|
189 | - 'html_name' => 'organization_state', |
|
190 | - 'html_label_text' => esc_html__('State/Province', 'event_espresso'), |
|
191 | - 'default' => $this->organization_config->STA_ID, |
|
192 | - 'required' => false, |
|
193 | - 'html_help_text' => empty($this->organization_config->STA_ID) || ! $has_sub_regions |
|
194 | - ? sprintf( |
|
195 | - esc_html__( |
|
196 | - 'If the States/Provinces for the selected Country do not appear in this list, then click "Save".%3$sIf data exists, then the list will be populated when the page reloads and you will be able to make a selection at that time.%3$s%1$sMake sure you click "Save" again after selecting a State/Province that has just been loaded in order to keep that selection.%2$s', |
|
197 | - 'event_espresso' |
|
198 | - ), |
|
199 | - '<span class="reminder-spn">', |
|
200 | - '</span>', |
|
201 | - '<br />' |
|
202 | - ) |
|
203 | - : '', |
|
204 | - ) |
|
205 | - ), |
|
206 | - 'organization_zip' => new EE_Text_Input( |
|
207 | - array( |
|
208 | - 'html_name' => 'organization_zip', |
|
209 | - 'html_label_text' => esc_html__('Zip/Postal Code', 'event_espresso'), |
|
210 | - 'default' => $this->organization_config->get_pretty('zip'), |
|
211 | - 'required' => false, |
|
212 | - ) |
|
213 | - ), |
|
214 | - 'organization_email' => new EE_Text_Input( |
|
215 | - array( |
|
216 | - 'html_name' => 'organization_email', |
|
217 | - 'html_label_text' => esc_html__('Primary Contact Email', 'event_espresso'), |
|
218 | - 'html_help_text' => sprintf( |
|
219 | - esc_html__( |
|
220 | - 'This is where notifications go to when you use the %1$s and %2$s shortcodes in the message templates.', |
|
221 | - 'event_espresso' |
|
222 | - ), |
|
223 | - '<code>[CO_FORMATTED_EMAIL]</code>', |
|
224 | - '<code>[CO_EMAIL]</code>' |
|
225 | - ), |
|
226 | - 'default' => $this->organization_config->get_pretty('email'), |
|
227 | - 'required' => false, |
|
228 | - ) |
|
229 | - ), |
|
230 | - 'organization_phone' => new EE_Text_Input( |
|
231 | - array( |
|
232 | - 'html_name' => 'organization_phone', |
|
233 | - 'html_label_text' => esc_html__('Phone Number', 'event_espresso'), |
|
234 | - 'html_help_text' => esc_html__( |
|
235 | - 'The phone number for your organization.', |
|
236 | - 'event_espresso' |
|
237 | - ), |
|
238 | - 'default' => $this->organization_config->get_pretty('phone'), |
|
239 | - 'required' => false, |
|
240 | - ) |
|
241 | - ), |
|
242 | - 'organization_vat' => new EE_Text_Input( |
|
243 | - array( |
|
244 | - 'html_name' => 'organization_vat', |
|
245 | - 'html_label_text' => esc_html__('VAT/Tax Number', 'event_espresso'), |
|
246 | - 'html_help_text' => esc_html__( |
|
247 | - 'The VAT/Tax Number may be displayed on invoices and receipts.', |
|
248 | - 'event_espresso' |
|
249 | - ), |
|
250 | - 'default' => $this->organization_config->get_pretty('vat'), |
|
251 | - 'required' => false, |
|
252 | - ) |
|
253 | - ), |
|
254 | - 'company_logo_hdr' => new EE_Form_Section_HTML( |
|
255 | - EEH_HTML::h2( |
|
256 | - esc_html__('Company Logo', 'event_espresso') |
|
257 | - . ' ' |
|
258 | - . EEH_HTML::span(EEH_Template::get_help_tab_link('organization_logo_info')), |
|
259 | - '', |
|
260 | - 'company-logo-hdr' |
|
261 | - ) |
|
262 | - ), |
|
263 | - 'organization_logo_url' => new EE_Admin_File_Uploader_Input( |
|
264 | - array( |
|
265 | - 'html_name' => 'organization_logo_url', |
|
266 | - 'html_label_text' => esc_html__('Upload New Logo', 'event_espresso'), |
|
267 | - 'html_help_text' => esc_html__( |
|
268 | - 'Your logo will be used on custom invoices, tickets, certificates, and payment templates.', |
|
269 | - 'event_espresso' |
|
270 | - ), |
|
271 | - 'default' => $this->organization_config->get_pretty('logo_url'), |
|
272 | - 'required' => false, |
|
273 | - ) |
|
274 | - ), |
|
275 | - 'social_links_hdr' => new EE_Form_Section_HTML( |
|
276 | - EEH_HTML::h2( |
|
277 | - esc_html__('Social Links', 'event_espresso') |
|
278 | - . ' ' |
|
279 | - . EEH_HTML::span(EEH_Template::get_help_tab_link('social_links_info')) |
|
280 | - . EEH_HTML::br() |
|
281 | - . EEH_HTML::p( |
|
282 | - esc_html__( |
|
283 | - 'Enter any links to social accounts for your organization here', |
|
284 | - 'event_espresso' |
|
285 | - ), |
|
286 | - '', |
|
287 | - 'description' |
|
288 | - ), |
|
289 | - '', |
|
290 | - 'social-links-hdr' |
|
291 | - ) |
|
292 | - ), |
|
293 | - 'organization_facebook' => new EE_Text_Input( |
|
294 | - array( |
|
295 | - 'html_name' => 'organization_facebook', |
|
296 | - 'html_label_text' => esc_html__('Facebook', 'event_espresso'), |
|
297 | - 'other_html_attributes' => ' placeholder="facebook.com/profile.name"', |
|
298 | - 'default' => $this->organization_config->get_pretty('facebook'), |
|
299 | - 'required' => false, |
|
300 | - ) |
|
301 | - ), |
|
302 | - 'organization_twitter' => new EE_Text_Input( |
|
303 | - array( |
|
304 | - 'html_name' => 'organization_twitter', |
|
305 | - 'html_label_text' => esc_html__('Twitter', 'event_espresso'), |
|
306 | - 'other_html_attributes' => ' placeholder="twitter.com/twitterhandle"', |
|
307 | - 'default' => $this->organization_config->get_pretty('twitter'), |
|
308 | - 'required' => false, |
|
309 | - ) |
|
310 | - ), |
|
311 | - 'organization_linkedin' => new EE_Text_Input( |
|
312 | - array( |
|
313 | - 'html_name' => 'organization_linkedin', |
|
314 | - 'html_label_text' => esc_html__('LinkedIn', 'event_espresso'), |
|
315 | - 'other_html_attributes' => ' placeholder="linkedin.com/in/profilename"', |
|
316 | - 'default' => $this->organization_config->get_pretty('linkedin'), |
|
317 | - 'required' => false, |
|
318 | - ) |
|
319 | - ), |
|
320 | - 'organization_pinterest' => new EE_Text_Input( |
|
321 | - array( |
|
322 | - 'html_name' => 'organization_pinterest', |
|
323 | - 'html_label_text' => esc_html__('Pinterest', 'event_espresso'), |
|
324 | - 'other_html_attributes' => ' placeholder="pinterest.com/profilename"', |
|
325 | - 'default' => $this->organization_config->get_pretty('pinterest'), |
|
326 | - 'required' => false, |
|
327 | - ) |
|
328 | - ), |
|
329 | - 'organization_instagram' => new EE_Text_Input( |
|
330 | - array( |
|
331 | - 'html_name' => 'organization_instagram', |
|
332 | - 'html_label_text' => esc_html__('Instagram', 'event_espresso'), |
|
333 | - 'other_html_attributes' => ' placeholder="instagram.com/handle"', |
|
334 | - 'default' => $this->organization_config->get_pretty('instagram'), |
|
335 | - 'required' => false, |
|
336 | - ) |
|
337 | - ), |
|
338 | - ), |
|
339 | - ) |
|
340 | - ); |
|
341 | - if (is_main_site()) { |
|
342 | - $form->add_subsections( |
|
343 | - array( |
|
344 | - 'site_license_key_hdr' => new EE_Form_Section_HTML( |
|
345 | - EEH_HTML::h2( |
|
346 | - esc_html__('Your Event Espresso License Key', 'event_espresso') |
|
347 | - . ' ' |
|
348 | - . EEH_HTML::span( |
|
349 | - EEH_Template::get_help_tab_link('site_license_key_info'), |
|
350 | - 'help_tour_activation' |
|
351 | - ), |
|
352 | - '', |
|
353 | - 'site-license-key-hdr' |
|
354 | - ) |
|
355 | - ), |
|
356 | - 'site_license_key' => $this->getSiteLicenseKeyField() |
|
357 | - ) |
|
358 | - ); |
|
359 | - $form->add_subsections( |
|
360 | - array( |
|
361 | - 'uxip_optin_hdr' => new EE_Form_Section_HTML( |
|
362 | - $this->uxipOptinText() |
|
363 | - ), |
|
364 | - 'ueip_optin' => new EE_Checkbox_Multi_Input( |
|
365 | - array( |
|
366 | - true => __('Yes! I want to help improve Event Espresso!', 'event_espresso') |
|
367 | - ), |
|
368 | - array( |
|
369 | - 'html_name' => EE_Core_Config::OPTION_NAME_UXIP, |
|
370 | - 'html_label_text' => esc_html__( |
|
371 | - 'UXIP Opt In?', |
|
372 | - 'event_espresso' |
|
373 | - ), |
|
374 | - 'default' => isset($this->core_config->ee_ueip_optin) |
|
375 | - ? filter_var($this->core_config->ee_ueip_optin, FILTER_VALIDATE_BOOLEAN) |
|
376 | - : false, |
|
377 | - 'required' => false, |
|
378 | - ) |
|
379 | - ), |
|
380 | - ), |
|
381 | - 'organization_instagram', |
|
382 | - false |
|
383 | - ); |
|
384 | - } |
|
385 | - return $form; |
|
386 | - } |
|
102 | + /** |
|
103 | + * creates and returns the actual form |
|
104 | + * |
|
105 | + * @return EE_Form_Section_Proper |
|
106 | + * @throws EE_Error |
|
107 | + * @throws InvalidArgumentException |
|
108 | + * @throws InvalidDataTypeException |
|
109 | + * @throws InvalidInterfaceException |
|
110 | + * @throws ReflectionException |
|
111 | + */ |
|
112 | + public function generate() |
|
113 | + { |
|
114 | + $has_sub_regions = EEM_State::instance()->count( |
|
115 | + array(array('Country.CNT_ISO' => $this->organization_config->CNT_ISO)) |
|
116 | + ); |
|
117 | + $form = new EE_Form_Section_Proper( |
|
118 | + array( |
|
119 | + 'name' => 'organization_settings', |
|
120 | + 'html_id' => 'organization_settings', |
|
121 | + 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
122 | + 'subsections' => array( |
|
123 | + 'contact_information_hdr' => new EE_Form_Section_HTML( |
|
124 | + EEH_HTML::h2( |
|
125 | + esc_html__('Contact Information', 'event_espresso') |
|
126 | + . ' ' |
|
127 | + . EEH_HTML::span(EEH_Template::get_help_tab_link('contact_info_info')), |
|
128 | + '', |
|
129 | + 'contact-information-hdr' |
|
130 | + ) |
|
131 | + ), |
|
132 | + 'organization_name' => new EE_Text_Input( |
|
133 | + array( |
|
134 | + 'html_name' => 'organization_name', |
|
135 | + 'html_label_text' => esc_html__('Organization Name', 'event_espresso'), |
|
136 | + 'html_help_text' => esc_html__( |
|
137 | + 'Displayed on all emails and invoices.', |
|
138 | + 'event_espresso' |
|
139 | + ), |
|
140 | + 'default' => $this->organization_config->get_pretty('name'), |
|
141 | + 'required' => false, |
|
142 | + ) |
|
143 | + ), |
|
144 | + 'organization_address_1' => new EE_Text_Input( |
|
145 | + array( |
|
146 | + 'html_name' => 'organization_address_1', |
|
147 | + 'html_label_text' => esc_html__('Street Address', 'event_espresso'), |
|
148 | + 'default' => $this->organization_config->get_pretty('address_1'), |
|
149 | + 'required' => false, |
|
150 | + ) |
|
151 | + ), |
|
152 | + 'organization_address_2' => new EE_Text_Input( |
|
153 | + array( |
|
154 | + 'html_name' => 'organization_address_2', |
|
155 | + 'html_label_text' => esc_html__('Street Address 2', 'event_espresso'), |
|
156 | + 'default' => $this->organization_config->get_pretty('address_2'), |
|
157 | + 'required' => false, |
|
158 | + ) |
|
159 | + ), |
|
160 | + 'organization_city' => new EE_Text_Input( |
|
161 | + array( |
|
162 | + 'html_name' => 'organization_city', |
|
163 | + 'html_label_text' => esc_html__('City', 'event_espresso'), |
|
164 | + 'default' => $this->organization_config->get_pretty('city'), |
|
165 | + 'required' => false, |
|
166 | + ) |
|
167 | + ), |
|
168 | + 'organization_country' => new EE_Country_Select_Input( |
|
169 | + null, |
|
170 | + array( |
|
171 | + EE_Country_Select_Input::OPTION_GET_KEY => EE_Country_Select_Input::OPTION_GET_ALL, |
|
172 | + 'html_name' => 'organization_country', |
|
173 | + 'html_label_text' => esc_html__('Country', 'event_espresso'), |
|
174 | + 'default' => $this->organization_config->CNT_ISO, |
|
175 | + 'required' => false, |
|
176 | + 'html_help_text' => sprintf( |
|
177 | + esc_html__( |
|
178 | + '%1$sThe Country set here will have the effect of setting the currency used for all ticket prices.%2$s', |
|
179 | + 'event_espresso' |
|
180 | + ), |
|
181 | + '<span class="reminder-spn">', |
|
182 | + '</span>' |
|
183 | + ), |
|
184 | + ) |
|
185 | + ), |
|
186 | + 'organization_state' => new EE_State_Select_Input( |
|
187 | + null, |
|
188 | + array( |
|
189 | + 'html_name' => 'organization_state', |
|
190 | + 'html_label_text' => esc_html__('State/Province', 'event_espresso'), |
|
191 | + 'default' => $this->organization_config->STA_ID, |
|
192 | + 'required' => false, |
|
193 | + 'html_help_text' => empty($this->organization_config->STA_ID) || ! $has_sub_regions |
|
194 | + ? sprintf( |
|
195 | + esc_html__( |
|
196 | + 'If the States/Provinces for the selected Country do not appear in this list, then click "Save".%3$sIf data exists, then the list will be populated when the page reloads and you will be able to make a selection at that time.%3$s%1$sMake sure you click "Save" again after selecting a State/Province that has just been loaded in order to keep that selection.%2$s', |
|
197 | + 'event_espresso' |
|
198 | + ), |
|
199 | + '<span class="reminder-spn">', |
|
200 | + '</span>', |
|
201 | + '<br />' |
|
202 | + ) |
|
203 | + : '', |
|
204 | + ) |
|
205 | + ), |
|
206 | + 'organization_zip' => new EE_Text_Input( |
|
207 | + array( |
|
208 | + 'html_name' => 'organization_zip', |
|
209 | + 'html_label_text' => esc_html__('Zip/Postal Code', 'event_espresso'), |
|
210 | + 'default' => $this->organization_config->get_pretty('zip'), |
|
211 | + 'required' => false, |
|
212 | + ) |
|
213 | + ), |
|
214 | + 'organization_email' => new EE_Text_Input( |
|
215 | + array( |
|
216 | + 'html_name' => 'organization_email', |
|
217 | + 'html_label_text' => esc_html__('Primary Contact Email', 'event_espresso'), |
|
218 | + 'html_help_text' => sprintf( |
|
219 | + esc_html__( |
|
220 | + 'This is where notifications go to when you use the %1$s and %2$s shortcodes in the message templates.', |
|
221 | + 'event_espresso' |
|
222 | + ), |
|
223 | + '<code>[CO_FORMATTED_EMAIL]</code>', |
|
224 | + '<code>[CO_EMAIL]</code>' |
|
225 | + ), |
|
226 | + 'default' => $this->organization_config->get_pretty('email'), |
|
227 | + 'required' => false, |
|
228 | + ) |
|
229 | + ), |
|
230 | + 'organization_phone' => new EE_Text_Input( |
|
231 | + array( |
|
232 | + 'html_name' => 'organization_phone', |
|
233 | + 'html_label_text' => esc_html__('Phone Number', 'event_espresso'), |
|
234 | + 'html_help_text' => esc_html__( |
|
235 | + 'The phone number for your organization.', |
|
236 | + 'event_espresso' |
|
237 | + ), |
|
238 | + 'default' => $this->organization_config->get_pretty('phone'), |
|
239 | + 'required' => false, |
|
240 | + ) |
|
241 | + ), |
|
242 | + 'organization_vat' => new EE_Text_Input( |
|
243 | + array( |
|
244 | + 'html_name' => 'organization_vat', |
|
245 | + 'html_label_text' => esc_html__('VAT/Tax Number', 'event_espresso'), |
|
246 | + 'html_help_text' => esc_html__( |
|
247 | + 'The VAT/Tax Number may be displayed on invoices and receipts.', |
|
248 | + 'event_espresso' |
|
249 | + ), |
|
250 | + 'default' => $this->organization_config->get_pretty('vat'), |
|
251 | + 'required' => false, |
|
252 | + ) |
|
253 | + ), |
|
254 | + 'company_logo_hdr' => new EE_Form_Section_HTML( |
|
255 | + EEH_HTML::h2( |
|
256 | + esc_html__('Company Logo', 'event_espresso') |
|
257 | + . ' ' |
|
258 | + . EEH_HTML::span(EEH_Template::get_help_tab_link('organization_logo_info')), |
|
259 | + '', |
|
260 | + 'company-logo-hdr' |
|
261 | + ) |
|
262 | + ), |
|
263 | + 'organization_logo_url' => new EE_Admin_File_Uploader_Input( |
|
264 | + array( |
|
265 | + 'html_name' => 'organization_logo_url', |
|
266 | + 'html_label_text' => esc_html__('Upload New Logo', 'event_espresso'), |
|
267 | + 'html_help_text' => esc_html__( |
|
268 | + 'Your logo will be used on custom invoices, tickets, certificates, and payment templates.', |
|
269 | + 'event_espresso' |
|
270 | + ), |
|
271 | + 'default' => $this->organization_config->get_pretty('logo_url'), |
|
272 | + 'required' => false, |
|
273 | + ) |
|
274 | + ), |
|
275 | + 'social_links_hdr' => new EE_Form_Section_HTML( |
|
276 | + EEH_HTML::h2( |
|
277 | + esc_html__('Social Links', 'event_espresso') |
|
278 | + . ' ' |
|
279 | + . EEH_HTML::span(EEH_Template::get_help_tab_link('social_links_info')) |
|
280 | + . EEH_HTML::br() |
|
281 | + . EEH_HTML::p( |
|
282 | + esc_html__( |
|
283 | + 'Enter any links to social accounts for your organization here', |
|
284 | + 'event_espresso' |
|
285 | + ), |
|
286 | + '', |
|
287 | + 'description' |
|
288 | + ), |
|
289 | + '', |
|
290 | + 'social-links-hdr' |
|
291 | + ) |
|
292 | + ), |
|
293 | + 'organization_facebook' => new EE_Text_Input( |
|
294 | + array( |
|
295 | + 'html_name' => 'organization_facebook', |
|
296 | + 'html_label_text' => esc_html__('Facebook', 'event_espresso'), |
|
297 | + 'other_html_attributes' => ' placeholder="facebook.com/profile.name"', |
|
298 | + 'default' => $this->organization_config->get_pretty('facebook'), |
|
299 | + 'required' => false, |
|
300 | + ) |
|
301 | + ), |
|
302 | + 'organization_twitter' => new EE_Text_Input( |
|
303 | + array( |
|
304 | + 'html_name' => 'organization_twitter', |
|
305 | + 'html_label_text' => esc_html__('Twitter', 'event_espresso'), |
|
306 | + 'other_html_attributes' => ' placeholder="twitter.com/twitterhandle"', |
|
307 | + 'default' => $this->organization_config->get_pretty('twitter'), |
|
308 | + 'required' => false, |
|
309 | + ) |
|
310 | + ), |
|
311 | + 'organization_linkedin' => new EE_Text_Input( |
|
312 | + array( |
|
313 | + 'html_name' => 'organization_linkedin', |
|
314 | + 'html_label_text' => esc_html__('LinkedIn', 'event_espresso'), |
|
315 | + 'other_html_attributes' => ' placeholder="linkedin.com/in/profilename"', |
|
316 | + 'default' => $this->organization_config->get_pretty('linkedin'), |
|
317 | + 'required' => false, |
|
318 | + ) |
|
319 | + ), |
|
320 | + 'organization_pinterest' => new EE_Text_Input( |
|
321 | + array( |
|
322 | + 'html_name' => 'organization_pinterest', |
|
323 | + 'html_label_text' => esc_html__('Pinterest', 'event_espresso'), |
|
324 | + 'other_html_attributes' => ' placeholder="pinterest.com/profilename"', |
|
325 | + 'default' => $this->organization_config->get_pretty('pinterest'), |
|
326 | + 'required' => false, |
|
327 | + ) |
|
328 | + ), |
|
329 | + 'organization_instagram' => new EE_Text_Input( |
|
330 | + array( |
|
331 | + 'html_name' => 'organization_instagram', |
|
332 | + 'html_label_text' => esc_html__('Instagram', 'event_espresso'), |
|
333 | + 'other_html_attributes' => ' placeholder="instagram.com/handle"', |
|
334 | + 'default' => $this->organization_config->get_pretty('instagram'), |
|
335 | + 'required' => false, |
|
336 | + ) |
|
337 | + ), |
|
338 | + ), |
|
339 | + ) |
|
340 | + ); |
|
341 | + if (is_main_site()) { |
|
342 | + $form->add_subsections( |
|
343 | + array( |
|
344 | + 'site_license_key_hdr' => new EE_Form_Section_HTML( |
|
345 | + EEH_HTML::h2( |
|
346 | + esc_html__('Your Event Espresso License Key', 'event_espresso') |
|
347 | + . ' ' |
|
348 | + . EEH_HTML::span( |
|
349 | + EEH_Template::get_help_tab_link('site_license_key_info'), |
|
350 | + 'help_tour_activation' |
|
351 | + ), |
|
352 | + '', |
|
353 | + 'site-license-key-hdr' |
|
354 | + ) |
|
355 | + ), |
|
356 | + 'site_license_key' => $this->getSiteLicenseKeyField() |
|
357 | + ) |
|
358 | + ); |
|
359 | + $form->add_subsections( |
|
360 | + array( |
|
361 | + 'uxip_optin_hdr' => new EE_Form_Section_HTML( |
|
362 | + $this->uxipOptinText() |
|
363 | + ), |
|
364 | + 'ueip_optin' => new EE_Checkbox_Multi_Input( |
|
365 | + array( |
|
366 | + true => __('Yes! I want to help improve Event Espresso!', 'event_espresso') |
|
367 | + ), |
|
368 | + array( |
|
369 | + 'html_name' => EE_Core_Config::OPTION_NAME_UXIP, |
|
370 | + 'html_label_text' => esc_html__( |
|
371 | + 'UXIP Opt In?', |
|
372 | + 'event_espresso' |
|
373 | + ), |
|
374 | + 'default' => isset($this->core_config->ee_ueip_optin) |
|
375 | + ? filter_var($this->core_config->ee_ueip_optin, FILTER_VALIDATE_BOOLEAN) |
|
376 | + : false, |
|
377 | + 'required' => false, |
|
378 | + ) |
|
379 | + ), |
|
380 | + ), |
|
381 | + 'organization_instagram', |
|
382 | + false |
|
383 | + ); |
|
384 | + } |
|
385 | + return $form; |
|
386 | + } |
|
387 | 387 | |
388 | 388 | |
389 | - /** |
|
390 | - * takes the generated form and displays it along with ony other non-form HTML that may be required |
|
391 | - * returns a string of HTML that can be directly echoed in a template |
|
392 | - * |
|
393 | - * @return string |
|
394 | - * @throws EE_Error |
|
395 | - * @throws InvalidArgumentException |
|
396 | - * @throws InvalidDataTypeException |
|
397 | - * @throws InvalidInterfaceException |
|
398 | - * @throws LogicException |
|
399 | - */ |
|
400 | - public function display() |
|
401 | - { |
|
402 | - $this->form()->enqueue_js(); |
|
403 | - return parent::display(); |
|
404 | - } |
|
389 | + /** |
|
390 | + * takes the generated form and displays it along with ony other non-form HTML that may be required |
|
391 | + * returns a string of HTML that can be directly echoed in a template |
|
392 | + * |
|
393 | + * @return string |
|
394 | + * @throws EE_Error |
|
395 | + * @throws InvalidArgumentException |
|
396 | + * @throws InvalidDataTypeException |
|
397 | + * @throws InvalidInterfaceException |
|
398 | + * @throws LogicException |
|
399 | + */ |
|
400 | + public function display() |
|
401 | + { |
|
402 | + $this->form()->enqueue_js(); |
|
403 | + return parent::display(); |
|
404 | + } |
|
405 | 405 | |
406 | 406 | |
407 | - /** |
|
408 | - * handles processing the form submission |
|
409 | - * returns true or false depending on whether the form was processed successfully or not |
|
410 | - * |
|
411 | - * @param array $form_data |
|
412 | - * @return bool |
|
413 | - * @throws InvalidFormSubmissionException |
|
414 | - * @throws EE_Error |
|
415 | - * @throws LogicException |
|
416 | - * @throws InvalidArgumentException |
|
417 | - * @throws InvalidDataTypeException |
|
418 | - * @throws ReflectionException |
|
419 | - */ |
|
420 | - public function process($form_data = array()) |
|
421 | - { |
|
422 | - // process form |
|
423 | - $valid_data = (array) parent::process($form_data); |
|
424 | - if (empty($valid_data)) { |
|
425 | - return false; |
|
426 | - } |
|
407 | + /** |
|
408 | + * handles processing the form submission |
|
409 | + * returns true or false depending on whether the form was processed successfully or not |
|
410 | + * |
|
411 | + * @param array $form_data |
|
412 | + * @return bool |
|
413 | + * @throws InvalidFormSubmissionException |
|
414 | + * @throws EE_Error |
|
415 | + * @throws LogicException |
|
416 | + * @throws InvalidArgumentException |
|
417 | + * @throws InvalidDataTypeException |
|
418 | + * @throws ReflectionException |
|
419 | + */ |
|
420 | + public function process($form_data = array()) |
|
421 | + { |
|
422 | + // process form |
|
423 | + $valid_data = (array) parent::process($form_data); |
|
424 | + if (empty($valid_data)) { |
|
425 | + return false; |
|
426 | + } |
|
427 | 427 | |
428 | - if (is_main_site()) { |
|
429 | - $this->network_core_config->site_license_key = isset($form_data['ee_site_license_key']) |
|
430 | - ? sanitize_text_field($form_data['ee_site_license_key']) |
|
431 | - : $this->network_core_config->site_license_key; |
|
432 | - } |
|
433 | - $this->organization_config->name = isset($form_data['organization_name']) |
|
434 | - ? sanitize_text_field($form_data['organization_name']) |
|
435 | - : $this->organization_config->name; |
|
436 | - $this->organization_config->address_1 = isset($form_data['organization_address_1']) |
|
437 | - ? sanitize_text_field($form_data['organization_address_1']) |
|
438 | - : $this->organization_config->address_1; |
|
439 | - $this->organization_config->address_2 = isset($form_data['organization_address_2']) |
|
440 | - ? sanitize_text_field($form_data['organization_address_2']) |
|
441 | - : $this->organization_config->address_2; |
|
442 | - $this->organization_config->city = isset($form_data['organization_city']) |
|
443 | - ? sanitize_text_field($form_data['organization_city']) |
|
444 | - : $this->organization_config->city; |
|
445 | - $this->organization_config->STA_ID = isset($form_data['organization_state']) |
|
446 | - ? absint($form_data['organization_state']) |
|
447 | - : $this->organization_config->STA_ID; |
|
448 | - $this->organization_config->CNT_ISO = isset($form_data['organization_country']) |
|
449 | - ? sanitize_text_field($form_data['organization_country']) |
|
450 | - : $this->organization_config->CNT_ISO; |
|
451 | - $this->organization_config->zip = isset($form_data['organization_zip']) |
|
452 | - ? sanitize_text_field($form_data['organization_zip']) |
|
453 | - : $this->organization_config->zip; |
|
454 | - $this->organization_config->email = isset($form_data['organization_email']) |
|
455 | - ? sanitize_email($form_data['organization_email']) |
|
456 | - : $this->organization_config->email; |
|
457 | - $this->organization_config->vat = isset($form_data['organization_vat']) |
|
458 | - ? sanitize_text_field($form_data['organization_vat']) |
|
459 | - : $this->organization_config->vat; |
|
460 | - $this->organization_config->phone = isset($form_data['organization_phone']) |
|
461 | - ? sanitize_text_field($form_data['organization_phone']) |
|
462 | - : $this->organization_config->phone; |
|
463 | - $this->organization_config->logo_url = isset($form_data['organization_logo_url']) |
|
464 | - ? esc_url_raw($form_data['organization_logo_url']) |
|
465 | - : $this->organization_config->logo_url; |
|
466 | - $this->organization_config->facebook = isset($form_data['organization_facebook']) |
|
467 | - ? esc_url_raw($form_data['organization_facebook']) |
|
468 | - : $this->organization_config->facebook; |
|
469 | - $this->organization_config->twitter = isset($form_data['organization_twitter']) |
|
470 | - ? esc_url_raw($form_data['organization_twitter']) |
|
471 | - : $this->organization_config->twitter; |
|
472 | - $this->organization_config->linkedin = isset($form_data['organization_linkedin']) |
|
473 | - ? esc_url_raw($form_data['organization_linkedin']) |
|
474 | - : $this->organization_config->linkedin; |
|
475 | - $this->organization_config->pinterest = isset($form_data['organization_pinterest']) |
|
476 | - ? esc_url_raw($form_data['organization_pinterest']) |
|
477 | - : $this->organization_config->pinterest; |
|
478 | - $this->organization_config->google = isset($form_data['organization_google']) |
|
479 | - ? esc_url_raw($form_data['organization_google']) |
|
480 | - : $this->organization_config->google; |
|
481 | - $this->organization_config->instagram = isset($form_data['organization_instagram']) |
|
482 | - ? esc_url_raw($form_data['organization_instagram']) |
|
483 | - : $this->organization_config->instagram; |
|
484 | - $this->core_config->ee_ueip_optin = isset($form_data[ EE_Core_Config::OPTION_NAME_UXIP ][0]) |
|
485 | - ? filter_var($form_data[ EE_Core_Config::OPTION_NAME_UXIP ][0], FILTER_VALIDATE_BOOLEAN) |
|
486 | - : false; |
|
487 | - $this->core_config->ee_ueip_has_notified = true; |
|
428 | + if (is_main_site()) { |
|
429 | + $this->network_core_config->site_license_key = isset($form_data['ee_site_license_key']) |
|
430 | + ? sanitize_text_field($form_data['ee_site_license_key']) |
|
431 | + : $this->network_core_config->site_license_key; |
|
432 | + } |
|
433 | + $this->organization_config->name = isset($form_data['organization_name']) |
|
434 | + ? sanitize_text_field($form_data['organization_name']) |
|
435 | + : $this->organization_config->name; |
|
436 | + $this->organization_config->address_1 = isset($form_data['organization_address_1']) |
|
437 | + ? sanitize_text_field($form_data['organization_address_1']) |
|
438 | + : $this->organization_config->address_1; |
|
439 | + $this->organization_config->address_2 = isset($form_data['organization_address_2']) |
|
440 | + ? sanitize_text_field($form_data['organization_address_2']) |
|
441 | + : $this->organization_config->address_2; |
|
442 | + $this->organization_config->city = isset($form_data['organization_city']) |
|
443 | + ? sanitize_text_field($form_data['organization_city']) |
|
444 | + : $this->organization_config->city; |
|
445 | + $this->organization_config->STA_ID = isset($form_data['organization_state']) |
|
446 | + ? absint($form_data['organization_state']) |
|
447 | + : $this->organization_config->STA_ID; |
|
448 | + $this->organization_config->CNT_ISO = isset($form_data['organization_country']) |
|
449 | + ? sanitize_text_field($form_data['organization_country']) |
|
450 | + : $this->organization_config->CNT_ISO; |
|
451 | + $this->organization_config->zip = isset($form_data['organization_zip']) |
|
452 | + ? sanitize_text_field($form_data['organization_zip']) |
|
453 | + : $this->organization_config->zip; |
|
454 | + $this->organization_config->email = isset($form_data['organization_email']) |
|
455 | + ? sanitize_email($form_data['organization_email']) |
|
456 | + : $this->organization_config->email; |
|
457 | + $this->organization_config->vat = isset($form_data['organization_vat']) |
|
458 | + ? sanitize_text_field($form_data['organization_vat']) |
|
459 | + : $this->organization_config->vat; |
|
460 | + $this->organization_config->phone = isset($form_data['organization_phone']) |
|
461 | + ? sanitize_text_field($form_data['organization_phone']) |
|
462 | + : $this->organization_config->phone; |
|
463 | + $this->organization_config->logo_url = isset($form_data['organization_logo_url']) |
|
464 | + ? esc_url_raw($form_data['organization_logo_url']) |
|
465 | + : $this->organization_config->logo_url; |
|
466 | + $this->organization_config->facebook = isset($form_data['organization_facebook']) |
|
467 | + ? esc_url_raw($form_data['organization_facebook']) |
|
468 | + : $this->organization_config->facebook; |
|
469 | + $this->organization_config->twitter = isset($form_data['organization_twitter']) |
|
470 | + ? esc_url_raw($form_data['organization_twitter']) |
|
471 | + : $this->organization_config->twitter; |
|
472 | + $this->organization_config->linkedin = isset($form_data['organization_linkedin']) |
|
473 | + ? esc_url_raw($form_data['organization_linkedin']) |
|
474 | + : $this->organization_config->linkedin; |
|
475 | + $this->organization_config->pinterest = isset($form_data['organization_pinterest']) |
|
476 | + ? esc_url_raw($form_data['organization_pinterest']) |
|
477 | + : $this->organization_config->pinterest; |
|
478 | + $this->organization_config->google = isset($form_data['organization_google']) |
|
479 | + ? esc_url_raw($form_data['organization_google']) |
|
480 | + : $this->organization_config->google; |
|
481 | + $this->organization_config->instagram = isset($form_data['organization_instagram']) |
|
482 | + ? esc_url_raw($form_data['organization_instagram']) |
|
483 | + : $this->organization_config->instagram; |
|
484 | + $this->core_config->ee_ueip_optin = isset($form_data[ EE_Core_Config::OPTION_NAME_UXIP ][0]) |
|
485 | + ? filter_var($form_data[ EE_Core_Config::OPTION_NAME_UXIP ][0], FILTER_VALIDATE_BOOLEAN) |
|
486 | + : false; |
|
487 | + $this->core_config->ee_ueip_has_notified = true; |
|
488 | 488 | |
489 | - $this->registry->CFG->currency = new EE_Currency_Config( |
|
490 | - $this->organization_config->CNT_ISO |
|
491 | - ); |
|
492 | - /** @var EE_Country $country */ |
|
493 | - $country = EEM_Country::instance()->get_one_by_ID($this->organization_config->CNT_ISO); |
|
494 | - if ($country instanceof EE_Country) { |
|
495 | - $country->set('CNT_active', 1); |
|
496 | - $country->save(); |
|
497 | - $this->countrySubRegionDao->saveCountrySubRegions($country); |
|
498 | - } |
|
499 | - return true; |
|
500 | - } |
|
489 | + $this->registry->CFG->currency = new EE_Currency_Config( |
|
490 | + $this->organization_config->CNT_ISO |
|
491 | + ); |
|
492 | + /** @var EE_Country $country */ |
|
493 | + $country = EEM_Country::instance()->get_one_by_ID($this->organization_config->CNT_ISO); |
|
494 | + if ($country instanceof EE_Country) { |
|
495 | + $country->set('CNT_active', 1); |
|
496 | + $country->save(); |
|
497 | + $this->countrySubRegionDao->saveCountrySubRegions($country); |
|
498 | + } |
|
499 | + return true; |
|
500 | + } |
|
501 | 501 | |
502 | 502 | |
503 | - /** |
|
504 | - * @return string |
|
505 | - */ |
|
506 | - private function uxipOptinText() |
|
507 | - { |
|
508 | - ob_start(); |
|
509 | - Stats::optinText(false); |
|
510 | - return ob_get_clean(); |
|
511 | - } |
|
503 | + /** |
|
504 | + * @return string |
|
505 | + */ |
|
506 | + private function uxipOptinText() |
|
507 | + { |
|
508 | + ob_start(); |
|
509 | + Stats::optinText(false); |
|
510 | + return ob_get_clean(); |
|
511 | + } |
|
512 | 512 | |
513 | 513 | |
514 | - /** |
|
515 | - * Return whether the site license key has been verified or not. |
|
516 | - * @return bool |
|
517 | - */ |
|
518 | - private function licenseKeyVerified() |
|
519 | - { |
|
520 | - if (empty($this->network_core_config->site_license_key)) { |
|
521 | - return false; |
|
522 | - } |
|
523 | - $ver_option_key = 'puvererr_' . basename(EE_PLUGIN_BASENAME); |
|
524 | - $verify_fail = get_option($ver_option_key, false); |
|
525 | - return $verify_fail === false |
|
526 | - || (! empty($this->network_core_config->site_license_key) |
|
527 | - && $verify_fail === false |
|
528 | - ); |
|
529 | - } |
|
514 | + /** |
|
515 | + * Return whether the site license key has been verified or not. |
|
516 | + * @return bool |
|
517 | + */ |
|
518 | + private function licenseKeyVerified() |
|
519 | + { |
|
520 | + if (empty($this->network_core_config->site_license_key)) { |
|
521 | + return false; |
|
522 | + } |
|
523 | + $ver_option_key = 'puvererr_' . basename(EE_PLUGIN_BASENAME); |
|
524 | + $verify_fail = get_option($ver_option_key, false); |
|
525 | + return $verify_fail === false |
|
526 | + || (! empty($this->network_core_config->site_license_key) |
|
527 | + && $verify_fail === false |
|
528 | + ); |
|
529 | + } |
|
530 | 530 | |
531 | 531 | |
532 | - /** |
|
533 | - * @return EE_Text_Input |
|
534 | - */ |
|
535 | - private function getSiteLicenseKeyField() |
|
536 | - { |
|
537 | - $text_input = new EE_Text_Input( |
|
538 | - array( |
|
539 | - 'html_name' => 'ee_site_license_key', |
|
540 | - 'html_id' => 'site_license_key', |
|
541 | - 'html_label_text' => esc_html__('Support License Key', 'event_espresso'), |
|
542 | - /** phpcs:disable WordPress.WP.I18n.UnorderedPlaceholdersText */ |
|
543 | - 'html_help_text' => sprintf( |
|
544 | - esc_html__( |
|
545 | - 'Adding a valid Support License Key will enable automatic update notifications and backend updates for Event Espresso Core and any installed add-ons. If this is a Development or Test site, %sDO NOT%s enter your Support License Key.', |
|
546 | - 'event_espresso' |
|
547 | - ), |
|
548 | - '<strong>', |
|
549 | - '</strong>' |
|
550 | - ), |
|
551 | - /** phpcs:enable */ |
|
552 | - 'default' => isset($this->network_core_config->site_license_key) |
|
553 | - ? $this->network_core_config->site_license_key |
|
554 | - : '', |
|
555 | - 'required' => false, |
|
556 | - 'form_html_filter' => new VsprintfFilter( |
|
557 | - '%2$s %1$s', |
|
558 | - array($this->getValidationIndicator()) |
|
559 | - ) |
|
560 | - ) |
|
561 | - ); |
|
562 | - return $text_input; |
|
563 | - } |
|
532 | + /** |
|
533 | + * @return EE_Text_Input |
|
534 | + */ |
|
535 | + private function getSiteLicenseKeyField() |
|
536 | + { |
|
537 | + $text_input = new EE_Text_Input( |
|
538 | + array( |
|
539 | + 'html_name' => 'ee_site_license_key', |
|
540 | + 'html_id' => 'site_license_key', |
|
541 | + 'html_label_text' => esc_html__('Support License Key', 'event_espresso'), |
|
542 | + /** phpcs:disable WordPress.WP.I18n.UnorderedPlaceholdersText */ |
|
543 | + 'html_help_text' => sprintf( |
|
544 | + esc_html__( |
|
545 | + 'Adding a valid Support License Key will enable automatic update notifications and backend updates for Event Espresso Core and any installed add-ons. If this is a Development or Test site, %sDO NOT%s enter your Support License Key.', |
|
546 | + 'event_espresso' |
|
547 | + ), |
|
548 | + '<strong>', |
|
549 | + '</strong>' |
|
550 | + ), |
|
551 | + /** phpcs:enable */ |
|
552 | + 'default' => isset($this->network_core_config->site_license_key) |
|
553 | + ? $this->network_core_config->site_license_key |
|
554 | + : '', |
|
555 | + 'required' => false, |
|
556 | + 'form_html_filter' => new VsprintfFilter( |
|
557 | + '%2$s %1$s', |
|
558 | + array($this->getValidationIndicator()) |
|
559 | + ) |
|
560 | + ) |
|
561 | + ); |
|
562 | + return $text_input; |
|
563 | + } |
|
564 | 564 | |
565 | 565 | |
566 | - /** |
|
567 | - * @return string |
|
568 | - */ |
|
569 | - private function getValidationIndicator() |
|
570 | - { |
|
571 | - $verified_class = $this->licenseKeyVerified() ? 'ee-icon-color-ee-green' : 'ee-icon-color-ee-red'; |
|
572 | - return '<span class="dashicons dashicons-admin-network ' . $verified_class . ' ee-icon-size-20"></span>'; |
|
573 | - } |
|
566 | + /** |
|
567 | + * @return string |
|
568 | + */ |
|
569 | + private function getValidationIndicator() |
|
570 | + { |
|
571 | + $verified_class = $this->licenseKeyVerified() ? 'ee-icon-color-ee-green' : 'ee-icon-color-ee-red'; |
|
572 | + return '<span class="dashicons dashicons-admin-network ' . $verified_class . ' ee-icon-size-20"></span>'; |
|
573 | + } |
|
574 | 574 | } |
@@ -5,9 +5,9 @@ |
||
5 | 5 | ?> |
6 | 6 | <header class="event-header"> |
7 | 7 | <?php echo "<{$tag} id=\"event-details-{$tag}-{$post->ID}\" class=\"entry-title\">"; ?> |
8 | - <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target();?>> |
|
8 | + <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target(); ?>> |
|
9 | 9 | <?php the_title(); ?> |
10 | 10 | </a> |
11 | 11 | <?php echo "</{$tag}>"; ?> |
12 | - <?php if ( ! is_archive() && has_excerpt( $post->ID )): the_excerpt(); endif;?> |
|
12 | + <?php if ( ! is_archive() && has_excerpt($post->ID)): the_excerpt(); endif; ?> |
|
13 | 13 | </header> |
@@ -11,61 +11,61 @@ |
||
11 | 11 | class EE_Radio_Button_Display_Strategy extends EE_Compound_Input_Display_Strategy |
12 | 12 | { |
13 | 13 | |
14 | - /** |
|
15 | - * |
|
16 | - * @throws EE_Error |
|
17 | - * @return string of html to display the field |
|
18 | - */ |
|
19 | - public function display() |
|
20 | - { |
|
21 | - $input = $this->get_input(); |
|
22 | - $input->set_label_sizes(); |
|
23 | - $label_size_class = $input->get_label_size_class(); |
|
24 | - $html = ''; |
|
25 | - foreach ($input->options() as $value => $display_text) { |
|
26 | - $value = $input->get_normalization_strategy()->unnormalize($value); |
|
14 | + /** |
|
15 | + * |
|
16 | + * @throws EE_Error |
|
17 | + * @return string of html to display the field |
|
18 | + */ |
|
19 | + public function display() |
|
20 | + { |
|
21 | + $input = $this->get_input(); |
|
22 | + $input->set_label_sizes(); |
|
23 | + $label_size_class = $input->get_label_size_class(); |
|
24 | + $html = ''; |
|
25 | + foreach ($input->options() as $value => $display_text) { |
|
26 | + $value = $input->get_normalization_strategy()->unnormalize($value); |
|
27 | 27 | |
28 | - $html_id = $this->get_sub_input_id($value); |
|
29 | - $html .= EEH_HTML::nl(0, 'radio'); |
|
28 | + $html_id = $this->get_sub_input_id($value); |
|
29 | + $html .= EEH_HTML::nl(0, 'radio'); |
|
30 | 30 | |
31 | - $html .= $this->_opening_tag('label'); |
|
32 | - $html .= $this->_attributes_string( |
|
33 | - array( |
|
34 | - 'for' => $html_id, |
|
35 | - 'id' => $html_id . '-lbl', |
|
36 | - 'class' => apply_filters( |
|
37 | - 'FHEE__EE_Radio_Button_Display_Strategy__display__option_label_class', |
|
38 | - 'ee-radio-label-after' . $label_size_class, |
|
39 | - $this, |
|
40 | - $input, |
|
41 | - $value |
|
42 | - ) |
|
43 | - ) |
|
44 | - ); |
|
45 | - $html .= '>'; |
|
46 | - $html .= EEH_HTML::nl(1, 'radio'); |
|
47 | - $html .= $this->_opening_tag('input'); |
|
48 | - $attributes = array( |
|
49 | - 'id' => $html_id, |
|
50 | - 'name' => $input->html_name(), |
|
51 | - 'class' => $input->html_class(), |
|
52 | - 'style' => $input->html_style(), |
|
53 | - 'type' => 'radio', |
|
54 | - 'value' => $value, |
|
55 | - 0 => $input->other_html_attributes(), |
|
56 | - 'data-question_label' => $input->html_label_id() |
|
57 | - ); |
|
58 | - if ($input->raw_value() === $value) { |
|
59 | - $attributes['checked'] = 'checked'; |
|
60 | - } |
|
61 | - $html .= $this->_attributes_string($attributes); |
|
31 | + $html .= $this->_opening_tag('label'); |
|
32 | + $html .= $this->_attributes_string( |
|
33 | + array( |
|
34 | + 'for' => $html_id, |
|
35 | + 'id' => $html_id . '-lbl', |
|
36 | + 'class' => apply_filters( |
|
37 | + 'FHEE__EE_Radio_Button_Display_Strategy__display__option_label_class', |
|
38 | + 'ee-radio-label-after' . $label_size_class, |
|
39 | + $this, |
|
40 | + $input, |
|
41 | + $value |
|
42 | + ) |
|
43 | + ) |
|
44 | + ); |
|
45 | + $html .= '>'; |
|
46 | + $html .= EEH_HTML::nl(1, 'radio'); |
|
47 | + $html .= $this->_opening_tag('input'); |
|
48 | + $attributes = array( |
|
49 | + 'id' => $html_id, |
|
50 | + 'name' => $input->html_name(), |
|
51 | + 'class' => $input->html_class(), |
|
52 | + 'style' => $input->html_style(), |
|
53 | + 'type' => 'radio', |
|
54 | + 'value' => $value, |
|
55 | + 0 => $input->other_html_attributes(), |
|
56 | + 'data-question_label' => $input->html_label_id() |
|
57 | + ); |
|
58 | + if ($input->raw_value() === $value) { |
|
59 | + $attributes['checked'] = 'checked'; |
|
60 | + } |
|
61 | + $html .= $this->_attributes_string($attributes); |
|
62 | 62 | |
63 | - $html .= '> '; |
|
64 | - $html .= $display_text; |
|
65 | - $html .= EEH_HTML::nl(-1, 'radio') . '</label>'; |
|
66 | - } |
|
67 | - $html .= EEH_HTML::div('', '', 'clear-float'); |
|
68 | - $html .= EEH_HTML::divx(); |
|
69 | - return apply_filters('FHEE__EE_Radio_Button_Display_Strategy__display', $html, $this, $this->_input); |
|
70 | - } |
|
63 | + $html .= '> '; |
|
64 | + $html .= $display_text; |
|
65 | + $html .= EEH_HTML::nl(-1, 'radio') . '</label>'; |
|
66 | + } |
|
67 | + $html .= EEH_HTML::div('', '', 'clear-float'); |
|
68 | + $html .= EEH_HTML::divx(); |
|
69 | + return apply_filters('FHEE__EE_Radio_Button_Display_Strategy__display', $html, $this, $this->_input); |
|
70 | + } |
|
71 | 71 | } |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $html .= $this->_attributes_string( |
33 | 33 | array( |
34 | 34 | 'for' => $html_id, |
35 | - 'id' => $html_id . '-lbl', |
|
35 | + 'id' => $html_id.'-lbl', |
|
36 | 36 | 'class' => apply_filters( |
37 | 37 | 'FHEE__EE_Radio_Button_Display_Strategy__display__option_label_class', |
38 | - 'ee-radio-label-after' . $label_size_class, |
|
38 | + 'ee-radio-label-after'.$label_size_class, |
|
39 | 39 | $this, |
40 | 40 | $input, |
41 | 41 | $value |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | $html .= '> '; |
64 | 64 | $html .= $display_text; |
65 | - $html .= EEH_HTML::nl(-1, 'radio') . '</label>'; |
|
65 | + $html .= EEH_HTML::nl(-1, 'radio').'</label>'; |
|
66 | 66 | } |
67 | 67 | $html .= EEH_HTML::div('', '', 'clear-float'); |
68 | 68 | $html .= EEH_HTML::divx(); |
@@ -3,33 +3,33 @@ |
||
3 | 3 | global $post; |
4 | 4 | ?> |
5 | 5 | <div class="event-content"> |
6 | -<?php if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_entry_meta', TRUE )): ?> |
|
6 | +<?php if (apply_filters('FHEE__content_espresso_events_details_template__display_entry_meta', TRUE)): ?> |
|
7 | 7 | <div class="entry-meta"> |
8 | - <span class="tags-links"><?php espresso_event_categories( $post->ID, TRUE, TRUE ); ?></span> |
|
8 | + <span class="tags-links"><?php espresso_event_categories($post->ID, TRUE, TRUE); ?></span> |
|
9 | 9 | <?php |
10 | - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : |
|
10 | + if ( ! post_password_required() && (comments_open() || get_comments_number())) : |
|
11 | 11 | ?> |
12 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'event_espresso' ), __( '1 Comment', 'event_espresso' ), __( '% Comments', 'event_espresso' ) ); ?></span> |
|
12 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'event_espresso'), __('1 Comment', 'event_espresso'), __('% Comments', 'event_espresso')); ?></span> |
|
13 | 13 | <?php |
14 | 14 | endif; |
15 | - edit_post_link( __( 'Edit', 'event_espresso' ), '<span class="edit-link">', '</span>' ); |
|
15 | + edit_post_link(__('Edit', 'event_espresso'), '<span class="edit-link">', '</span>'); |
|
16 | 16 | ?> |
17 | 17 | </div> |
18 | 18 | <?php endif; |
19 | - $event_phone = espresso_event_phone( $post->ID, FALSE ); |
|
20 | - if ( $event_phone != '' ) : ?> |
|
19 | + $event_phone = espresso_event_phone($post->ID, FALSE); |
|
20 | + if ($event_phone != '') : ?> |
|
21 | 21 | <p class="event-phone"> |
22 | - <span class="small-text"><strong><?php esc_html_e( 'Event Phone:', 'event_espresso' ); ?> </strong></span> <?php echo $event_phone; ?> |
|
22 | + <span class="small-text"><strong><?php esc_html_e('Event Phone:', 'event_espresso'); ?> </strong></span> <?php echo $event_phone; ?> |
|
23 | 23 | </p> |
24 | -<?php endif; ?> |
|
24 | +<?php endif; ?> |
|
25 | 25 | <?php |
26 | - if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_the_content', true ) ) { |
|
27 | - do_action( 'AHEE_event_details_before_the_content', $post ); |
|
26 | + if (apply_filters('FHEE__content_espresso_events_details_template__display_the_content', true)) { |
|
27 | + do_action('AHEE_event_details_before_the_content', $post); |
|
28 | 28 | echo apply_filters( |
29 | 29 | 'FHEE__content_espresso_events_details_template__the_content', |
30 | - espresso_event_content_or_excerpt( 55, null, false ) |
|
30 | + espresso_event_content_or_excerpt(55, null, false) |
|
31 | 31 | ); |
32 | - do_action( 'AHEE_event_details_after_the_content', $post ); |
|
32 | + do_action('AHEE_event_details_after_the_content', $post); |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </div> |
@@ -16,74 +16,74 @@ |
||
16 | 16 | class EraseAttendeeData implements PersonalDataEraserInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @var EEM_Attendee |
|
21 | - */ |
|
22 | - protected $attendee_model; |
|
19 | + /** |
|
20 | + * @var EEM_Attendee |
|
21 | + */ |
|
22 | + protected $attendee_model; |
|
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * EraseAttendeeData constructor. |
|
27 | - * |
|
28 | - * @param EEM_Attendee $attendee_model |
|
29 | - */ |
|
30 | - public function __construct(EEM_Attendee $attendee_model) |
|
31 | - { |
|
32 | - $this->attendee_model = $attendee_model; |
|
33 | - } |
|
25 | + /** |
|
26 | + * EraseAttendeeData constructor. |
|
27 | + * |
|
28 | + * @param EEM_Attendee $attendee_model |
|
29 | + */ |
|
30 | + public function __construct(EEM_Attendee $attendee_model) |
|
31 | + { |
|
32 | + $this->attendee_model = $attendee_model; |
|
33 | + } |
|
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * Gets a translated string name for the data eraser |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function name() |
|
42 | - { |
|
43 | - return esc_html__('Event Espresso Attendee Data', 'event_espresso'); |
|
44 | - } |
|
36 | + /** |
|
37 | + * Gets a translated string name for the data eraser |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function name() |
|
42 | + { |
|
43 | + return esc_html__('Event Espresso Attendee Data', 'event_espresso'); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * Erases a "page" of personal user data |
|
49 | - * |
|
50 | - * @return array { |
|
51 | - * @type boolean $items_removed whether items were removed successfully or not |
|
52 | - * @type boolean $items_retained whether any items were skipped or not |
|
53 | - * @type array $messages values are messages to show |
|
54 | - * @type boolean $done whether this eraser is done or has more pages |
|
55 | - * } |
|
56 | - * @throws \EE_Error |
|
57 | - */ |
|
58 | - public function erase($email_address, $page = 1) |
|
59 | - { |
|
60 | - $rows_updated = $this->attendee_model->update( |
|
61 | - array( |
|
62 | - 'ATT_fname' => esc_html__('Anonymous', 'event_espresso'), |
|
63 | - 'ATT_lname' => '', |
|
64 | - 'ATT_email' => '', |
|
65 | - 'ATT_address' => '', |
|
66 | - 'ATT_address2' => '', |
|
67 | - 'ATT_city' => '', |
|
68 | - 'STA_ID' => 0, |
|
69 | - 'CNT_ISO' => '', |
|
70 | - 'ATT_zip' => '', |
|
71 | - 'ATT_phone' => '', |
|
72 | - ), |
|
73 | - array( |
|
74 | - array( |
|
75 | - 'ATT_email' => $email_address, |
|
76 | - ), |
|
77 | - ) |
|
78 | - ); |
|
47 | + /** |
|
48 | + * Erases a "page" of personal user data |
|
49 | + * |
|
50 | + * @return array { |
|
51 | + * @type boolean $items_removed whether items were removed successfully or not |
|
52 | + * @type boolean $items_retained whether any items were skipped or not |
|
53 | + * @type array $messages values are messages to show |
|
54 | + * @type boolean $done whether this eraser is done or has more pages |
|
55 | + * } |
|
56 | + * @throws \EE_Error |
|
57 | + */ |
|
58 | + public function erase($email_address, $page = 1) |
|
59 | + { |
|
60 | + $rows_updated = $this->attendee_model->update( |
|
61 | + array( |
|
62 | + 'ATT_fname' => esc_html__('Anonymous', 'event_espresso'), |
|
63 | + 'ATT_lname' => '', |
|
64 | + 'ATT_email' => '', |
|
65 | + 'ATT_address' => '', |
|
66 | + 'ATT_address2' => '', |
|
67 | + 'ATT_city' => '', |
|
68 | + 'STA_ID' => 0, |
|
69 | + 'CNT_ISO' => '', |
|
70 | + 'ATT_zip' => '', |
|
71 | + 'ATT_phone' => '', |
|
72 | + ), |
|
73 | + array( |
|
74 | + array( |
|
75 | + 'ATT_email' => $email_address, |
|
76 | + ), |
|
77 | + ) |
|
78 | + ); |
|
79 | 79 | |
80 | - return array( |
|
81 | - 'items_removed' => (bool) $rows_updated, |
|
82 | - 'items_retained' => false, // always false in this example |
|
83 | - 'messages' => array(), |
|
84 | - 'done' => true, |
|
85 | - ); |
|
86 | - } |
|
80 | + return array( |
|
81 | + 'items_removed' => (bool) $rows_updated, |
|
82 | + 'items_retained' => false, // always false in this example |
|
83 | + 'messages' => array(), |
|
84 | + 'done' => true, |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | // End of file EraseAttendeeData.php |
89 | 89 | // Location: EventEspresso\core\domain\services\privacy\erasure/EraseAttendeeData.php |
@@ -23,12 +23,15 @@ |
||
23 | 23 | <input id="reg-admin-attendee-questions-submit" class="button-primary" value="Update Registration Questions" |
24 | 24 | type="submit"/> |
25 | 25 | <?php endif; ?> |
26 | - <?php else : ?> |
|
26 | + <?php else { |
|
27 | + : ?> |
|
27 | 28 | <p class="ee-attention"> |
28 | 29 | <?php _e( |
29 | 30 | 'There were no custom questions asked for this registration.', |
30 | 31 | 'event_espresso' |
31 | - ); ?></p> |
|
32 | + ); |
|
33 | +} |
|
34 | +?></p> |
|
32 | 35 | <?php endif; ?> |
33 | 36 | |
34 | 37 | </form> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <div id="admin-primary-mbox-questions-dv" class="admin-primary-mbox-dv"> |
2 | 2 | <p> |
3 | 3 | <?php _e( |
4 | - 'This displays the custom questions and answers for this registrant. Please note that any answers to system questions have been saved with the contact record. You can edit those answers via the "View/Edit this Contact" link in the Contact Details metabox in the sidebar.', |
|
5 | - 'event_espresso' |
|
6 | - ); ?></p> |
|
4 | + 'This displays the custom questions and answers for this registrant. Please note that any answers to system questions have been saved with the contact record. You can edit those answers via the "View/Edit this Contact" link in the Contact Details metabox in the sidebar.', |
|
5 | + 'event_espresso' |
|
6 | + ); ?></p> |
|
7 | 7 | |
8 | 8 | <form name="reg-admin-attendee-questions-frm" id="reg-admin-attendee-questions-frm" |
9 | 9 | action="<?php echo REG_ADMIN_URL; ?>" method="post"> |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | <?php echo $att_questions; ?> |
17 | 17 | <?php if (! empty($att_questions)) : ?> |
18 | 18 | <?php if ( |
19 | - EE_Registry::instance()->CAP->current_user_can( |
|
20 | - 'ee_edit_registration', |
|
21 | - 'edit-reg-questions-mbox', |
|
22 | - $REG_ID |
|
23 | - ) |
|
19 | + EE_Registry::instance()->CAP->current_user_can( |
|
20 | + 'ee_edit_registration', |
|
21 | + 'edit-reg-questions-mbox', |
|
22 | + $REG_ID |
|
23 | + ) |
|
24 | 24 | ) : ?> |
25 | 25 | <input id="reg-admin-attendee-questions-submit" class="button-primary" value="Update Registration Questions" |
26 | 26 | type="submit"/> |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | <?php else : ?> |
29 | 29 | <p class="ee-attention"> |
30 | 30 | <?php _e( |
31 | - 'There were no custom questions asked for this registration.', |
|
32 | - 'event_espresso' |
|
33 | - ); ?></p> |
|
31 | + 'There were no custom questions asked for this registration.', |
|
32 | + 'event_espresso' |
|
33 | + ); ?></p> |
|
34 | 34 | <?php endif; ?> |
35 | 35 | |
36 | 36 | </form> |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | <form name="reg-admin-attendee-questions-frm" id="reg-admin-attendee-questions-frm" |
9 | 9 | action="<?php echo REG_ADMIN_URL; ?>" method="post"> |
10 | - <?php wp_nonce_field($reg_questions_form_action . '_nonce', $reg_questions_form_action . '_nonce'); ?> |
|
10 | + <?php wp_nonce_field($reg_questions_form_action.'_nonce', $reg_questions_form_action.'_nonce'); ?> |
|
11 | 11 | <input type="hidden" name="page" value="<?php echo REG_PG_SLUG; ?>"/> |
12 | 12 | <input type="hidden" name="action" value="<?php echo $reg_questions_form_action; ?>"/> |
13 | 13 | <input type="hidden" name="_REG_ID" value="<?php echo $REG_ID; ?>"/> |
14 | 14 | <input type="hidden" name="espresso_ajax" id="espresso-ajax" value="0"/> |
15 | 15 | <input type="hidden" name="noheader" id="reg-admin-noheader-inp" value="true"/> |
16 | 16 | <?php echo $att_questions; ?> |
17 | - <?php if (! empty($att_questions)) : ?> |
|
17 | + <?php if ( ! empty($att_questions)) : ?> |
|
18 | 18 | <?php if ( |
19 | 19 | EE_Registry::instance()->CAP->current_user_can( |
20 | 20 | 'ee_edit_registration', |
@@ -22,70 +22,70 @@ |
||
22 | 22 | interface BlockInterface |
23 | 23 | { |
24 | 24 | |
25 | - const NAME_SPACE = 'eventespresso'; |
|
26 | - |
|
27 | - /** |
|
28 | - * Perform any early setup required by the block |
|
29 | - * including setting the block type and supported post types |
|
30 | - * |
|
31 | - * @return void |
|
32 | - */ |
|
33 | - public function initialize(); |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - public function blockType(); |
|
40 | - |
|
41 | - |
|
42 | - /** |
|
43 | - * AssetRegister that this editor block uses for asset registration |
|
44 | - * |
|
45 | - * @return BlockAssetManagerInterface |
|
46 | - */ |
|
47 | - public function assetManager(); |
|
48 | - |
|
49 | - |
|
50 | - /** |
|
51 | - * Registers the Editor Block with WP core; |
|
52 | - * Returns the registered block type on success, or false on failure. |
|
53 | - * |
|
54 | - * @return WP_Block_Type|false |
|
55 | - */ |
|
56 | - public function registerBlock(); |
|
57 | - |
|
58 | - |
|
59 | - /** |
|
60 | - * Un-registers the Editor Block with WP core; |
|
61 | - * Returns the registered block type on success, or false on failure. |
|
62 | - * |
|
63 | - * @return WP_Block_Type|false |
|
64 | - */ |
|
65 | - public function unRegisterBlock(); |
|
66 | - |
|
67 | - |
|
68 | - /** |
|
69 | - * returns an array of fully qualified class names |
|
70 | - * for RouteMatchSpecificationInterface objects |
|
71 | - * that specify routes that the block should be loaded for. |
|
72 | - * |
|
73 | - * @return array |
|
74 | - */ |
|
75 | - public function supportedRoutes(); |
|
76 | - |
|
77 | - |
|
78 | - /** |
|
79 | - * @return array |
|
80 | - */ |
|
81 | - public function getEditorContainer(); |
|
82 | - |
|
83 | - |
|
84 | - /** |
|
85 | - * returns the rendered HTML for the block |
|
86 | - * |
|
87 | - * @param array $attributes |
|
88 | - * @return string |
|
89 | - */ |
|
90 | - public function renderBlock(array $attributes = array()); |
|
25 | + const NAME_SPACE = 'eventespresso'; |
|
26 | + |
|
27 | + /** |
|
28 | + * Perform any early setup required by the block |
|
29 | + * including setting the block type and supported post types |
|
30 | + * |
|
31 | + * @return void |
|
32 | + */ |
|
33 | + public function initialize(); |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + public function blockType(); |
|
40 | + |
|
41 | + |
|
42 | + /** |
|
43 | + * AssetRegister that this editor block uses for asset registration |
|
44 | + * |
|
45 | + * @return BlockAssetManagerInterface |
|
46 | + */ |
|
47 | + public function assetManager(); |
|
48 | + |
|
49 | + |
|
50 | + /** |
|
51 | + * Registers the Editor Block with WP core; |
|
52 | + * Returns the registered block type on success, or false on failure. |
|
53 | + * |
|
54 | + * @return WP_Block_Type|false |
|
55 | + */ |
|
56 | + public function registerBlock(); |
|
57 | + |
|
58 | + |
|
59 | + /** |
|
60 | + * Un-registers the Editor Block with WP core; |
|
61 | + * Returns the registered block type on success, or false on failure. |
|
62 | + * |
|
63 | + * @return WP_Block_Type|false |
|
64 | + */ |
|
65 | + public function unRegisterBlock(); |
|
66 | + |
|
67 | + |
|
68 | + /** |
|
69 | + * returns an array of fully qualified class names |
|
70 | + * for RouteMatchSpecificationInterface objects |
|
71 | + * that specify routes that the block should be loaded for. |
|
72 | + * |
|
73 | + * @return array |
|
74 | + */ |
|
75 | + public function supportedRoutes(); |
|
76 | + |
|
77 | + |
|
78 | + /** |
|
79 | + * @return array |
|
80 | + */ |
|
81 | + public function getEditorContainer(); |
|
82 | + |
|
83 | + |
|
84 | + /** |
|
85 | + * returns the rendered HTML for the block |
|
86 | + * |
|
87 | + * @param array $attributes |
|
88 | + * @return string |
|
89 | + */ |
|
90 | + public function renderBlock(array $attributes = array()); |
|
91 | 91 | } |
@@ -18,46 +18,46 @@ |
||
18 | 18 | abstract class BlockManager |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * @var CollectionInterface|BlockInterface[] $blocks |
|
23 | - */ |
|
24 | - protected $blocks; |
|
25 | - |
|
26 | - /** |
|
27 | - * @var RequestInterface $request |
|
28 | - */ |
|
29 | - protected $request; |
|
30 | - |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * BlockManager constructor. |
|
35 | - * |
|
36 | - * @param BlockCollection $blocks |
|
37 | - * @param RequestInterface $request |
|
38 | - */ |
|
39 | - public function __construct( |
|
40 | - BlockCollection $blocks, |
|
41 | - RequestInterface $request |
|
42 | - ) { |
|
43 | - $this->blocks = $blocks; |
|
44 | - $this->request = $request; |
|
45 | - add_action($this->initHook(), array($this, 'initialize')); |
|
46 | - } |
|
47 | - |
|
48 | - |
|
49 | - /** |
|
50 | - * Returns the name of a hookpoint to be used to call initialize() |
|
51 | - * |
|
52 | - * @return string |
|
53 | - */ |
|
54 | - abstract public function initHook(); |
|
55 | - |
|
56 | - |
|
57 | - /** |
|
58 | - * Perform any early setup required for block editors to functions |
|
59 | - * |
|
60 | - * @return void |
|
61 | - */ |
|
62 | - abstract public function initialize(); |
|
21 | + /** |
|
22 | + * @var CollectionInterface|BlockInterface[] $blocks |
|
23 | + */ |
|
24 | + protected $blocks; |
|
25 | + |
|
26 | + /** |
|
27 | + * @var RequestInterface $request |
|
28 | + */ |
|
29 | + protected $request; |
|
30 | + |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * BlockManager constructor. |
|
35 | + * |
|
36 | + * @param BlockCollection $blocks |
|
37 | + * @param RequestInterface $request |
|
38 | + */ |
|
39 | + public function __construct( |
|
40 | + BlockCollection $blocks, |
|
41 | + RequestInterface $request |
|
42 | + ) { |
|
43 | + $this->blocks = $blocks; |
|
44 | + $this->request = $request; |
|
45 | + add_action($this->initHook(), array($this, 'initialize')); |
|
46 | + } |
|
47 | + |
|
48 | + |
|
49 | + /** |
|
50 | + * Returns the name of a hookpoint to be used to call initialize() |
|
51 | + * |
|
52 | + * @return string |
|
53 | + */ |
|
54 | + abstract public function initHook(); |
|
55 | + |
|
56 | + |
|
57 | + /** |
|
58 | + * Perform any early setup required for block editors to functions |
|
59 | + * |
|
60 | + * @return void |
|
61 | + */ |
|
62 | + abstract public function initialize(); |
|
63 | 63 | } |