xtxpatch saves the email settings, still need to handle them

This commit is contained in:
asus
2024-03-31 19:25:39 +02:00
parent b4745ff672
commit 995e230e32
4 changed files with 40 additions and 9 deletions

View File

@@ -46,6 +46,42 @@ function menu_content() {
function define_register_email($request, $option_name, $option_value, $option_default) {
/*
* email
*
*/
$email = '';
if (isset($request['email'])) {
$email = $request['email'];
}
/*
* is email ?
*
*/
$is_email_prof = false;
if (isset($request['is_email_prof']) && $request['is_email_prof'] === 'on') {
$is_email_prof = true;
}
$is_email_partner = false;
if (isset($request['is_email_partner']) && $request['is_email_partner'] === 'on') {
$is_email_partner = true;
}
/*
* update the option with new values
*
*/
$option_data = array(
'email' => $email,
'is_email_prof' => $is_email_prof,
'is_email_partner' => $is_email_partner,
);
\Plgntls_xtx::update_option_safe($option_name, $option_data);
}