diff options
author | thomascube <thomas@roundcube.net> | 2011-09-12 19:56:12 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-09-12 19:56:12 +0000 |
commit | 1cc9e210f5cb340599062ae9cee15cdc9ebd77a7 (patch) | |
tree | 7757e25c7e38d9542ca849e4e2c053362854e84d /program/steps/settings/save_prefs.inc | |
parent | 891b3c13e0ce9e0c56fb47a555f19a7975311748 (diff) |
Make date/time format user configurable; drop 'date_today' config option
Diffstat (limited to 'program/steps/settings/save_prefs.inc')
-rw-r--r-- | program/steps/settings/save_prefs.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 7155575fc..a32f5948c 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -32,9 +32,17 @@ switch ($CURR_SECTION) 'timezone' => isset($_POST['_timezone']) ? (is_numeric($_POST['_timezone']) ? floatval($_POST['_timezone']) : get_input_value('_timezone', RCUBE_INPUT_POST)) : $CONFIG['timezone'], 'dst_active' => isset($_POST['_dst_active']) ? TRUE : FALSE, 'pagesize' => is_numeric($_POST['_pagesize']) ? max(2, intval($_POST['_pagesize'])) : $CONFIG['pagesize'], + 'date_format' => isset($_POST['_date_format']) ? get_input_value('_date_format', RCUBE_INPUT_POST) : $CONFIG['date_format'], + 'time_format' => isset($_POST['_time_format']) ? get_input_value('_time_format', RCUBE_INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'), 'prettydate' => isset($_POST['_pretty_date']) ? TRUE : FALSE, 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'], ); + + // compose derived date/time format strings + if ((isset($_POST['_date_format']) || isset($_POST['_time_format'])) && $a_user_prefs['date_format'] && $a_user_prefs['time_format']) { + $a_user_prefs['date_short'] = 'D ' . $a_user_prefs['time_format']; + $a_user_prefs['date_long'] = $a_user_prefs['date_format'] . ' ' . $a_user_prefs['time_format']; + } break; |