From d656f1ca71de0ec88da9ac84987bdeb44e371ccf Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 7 Sep 2006 18:51:16 +0000 Subject: Made automatic draft saving configurable --- program/steps/settings/func.inc | 24 ++++++++++++++++++++---- program/steps/settings/save_prefs.inc | 3 ++- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index a22ac9ae6..f08b75af8 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -46,10 +46,13 @@ function rcmail_user_prefs_form($attrib) // return the complete edit form as table $out = "$form_start\n\n"; - $a_show_cols = array('language' => array('type' => 'text'), - 'pagesize' => array('type' => 'text'), - 'timezone' => array('type' => 'text'), - 'prettydate' => array('type' => 'text')); + $a_show_cols = array( + 'language' => array('type' => 'text'), + 'pagesize' => array('type' => 'text'), + 'timezone' => array('type' => 'text'), + 'prettydate' => array('type' => 'text'), + 'draft_autosave' => array('type' => 'text') + ); // show language selection $a_lang = rcube_list_languages(); @@ -144,6 +147,19 @@ function rcmail_user_prefs_form($attrib) rep_specialchars_output(rcube_label('prettydate')), $input_prettydate->show($CONFIG['prettydate']?1:0)); + if (!empty($CONFIG['drafts_mbox'])) + { + $field_id = 'rcmfd_autosave'; + $select_autosave = new select(array('name' => '_draft_autosave', 'id' => $field_id)); + $select_autosave->add(rcube_label('never'), 0); + foreach (array(3, 5, 10) as $i => $min) + $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); + + $out .= sprintf("%s\n", + $field_id, + rep_specialchars_output(rcube_label('autosavedraft')), + $select_autosave->show($CONFIG['draft_autosave'])); + } $out .= "\n$form_end"; diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 98912daae..73fb231f2 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -28,13 +28,14 @@ $a_user_prefs['timezone'] = isset($_POST['_timezone']) ? floatval($_POST['_timez $a_user_prefs['dst_active'] = isset($_POST['_dst_active']) ? TRUE : FALSE; $a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize']; $a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE; +$a_user_prefs['draft_autosave'] = isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0; // MM: Date format toggle (Pretty / Standard) $a_user_prefs['prettydate'] = isset($_POST['_pretty_date']) ? TRUE : FALSE; if (isset($_POST['_language'])) { - $sess_user_lang = $_SESSION['user_lang'] = $_POST['_language']; + $sess_user_lang = $_SESSION['user_lang'] = get_input_value('_language', RCUBE_INPUT_POST); rcmail_set_locale($sess_user_lang); } -- cgit v1.2.3