From 2f1eaca8a7fc2739c81ce877e70559af4e63594b Mon Sep 17 00:00:00 2001 From: Amani Nyumu Date: Fri, 25 Oct 2024 08:01:23 +0100 Subject: [PATCH] [ENH]add Cypht-delay-send-later-scheduled-sending --- modules/core/functions.php | 24 +- modules/core/site.js | 48 ++-- modules/imap/functions.php | 12 +- modules/imap/handler_modules.php | 2 +- modules/imap/js_modules/route_handlers.js | 19 +- .../utils/handleNexterDateAction.js | 55 ++++ modules/imap/site.js | 66 ----- modules/smtp/js_modules/route_handlers.js | 77 ++--- modules/smtp/modules.php | 204 ++++++------- modules/smtp/site.js | 271 +----------------- 10 files changed, 266 insertions(+), 512 deletions(-) create mode 100644 modules/imap/js_modules/utils/handleNexterDateAction.js diff --git a/modules/core/functions.php b/modules/core/functions.php index e196c9917..49db78a57 100644 --- a/modules/core/functions.php +++ b/modules/core/functions.php @@ -619,8 +619,26 @@ function check_file_upload($request, $key) { return true; }} -if (!hm_exists('get_nexter_date')) { -function get_nexter_date($format, $only_label = false) { +function privacy_setting_callback($val, $key, $mod) { + $setting = Hm_Output_privacy_settings::$settings[$key]; + $key .= '_setting'; + $user_setting = $mod->user_config->get($key); + $update = $mod->request->post['update']; + + if ($update) { + $val = implode($setting['separator'], array_filter(array_merge(explode($setting['separator'], $user_setting), [$val]))); + $mod->user_config->set($key, $val); + + $user_data = $mod->session->get('user_data', array()); + $user_data[$key] = $val; + $mod->session->set('user_data', $user_data); + $mod->session->record_unsaved('Privacy settings updated'); + } + return $val; +} + +if (!hm_exists('get_scheduled_date')) { +function get_scheduled_date($format, $only_label = false) { if ($format == 'later_in_day') { $date_string = 'today 18:00'; $label = 'Later in the day'; @@ -675,7 +693,7 @@ function schedule_dropdown($output, $send_now = false) { } $txt .= '