summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/edit_folder.inc6
-rw-r--r--program/steps/settings/folders.inc7
-rw-r--r--program/steps/settings/save_folder.inc14
3 files changed, 13 insertions, 14 deletions
diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc
index 6b7bd08d2..8ac51658c 100644
--- a/program/steps/settings/edit_folder.inc
+++ b/program/steps/settings/edit_folder.inc
@@ -163,8 +163,10 @@ function rcmail_folder_form($attrib)
$value = (int) $_POST['_viewmode'];
}
else if (strlen($mbox_imap)) {
- $a_threaded = $RCMAIL->config->get('message_threading', array());
- $value = (int) isset($a_threaded[$mbox_imap]);
+ $a_threaded = $RCMAIL->config->get('message_threading', array());
+ $default_mode = $RCMAIL->config->get('default_list_mode', 'list');
+
+ $value = (int) (isset($a_threaded[$mbox_imap]) ? $a_threaded[$mbox_imap] : $default_mode == 'threads');
}
$form['props']['fieldsets']['settings']['content']['viewmode'] = array(
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index b09ea03ce..4f92298e3 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -407,16 +407,17 @@ function rcmail_rename_folder($oldname, $newname)
$a_threaded = (array) $RCMAIL->config->get('message_threading', array());
$oldprefix = '/^' . preg_quote($oldname . $delimiter, '/') . '/';
- foreach (array_keys($a_threaded) as $key) {
+ foreach ($a_threaded as $key => $val) {
if ($key == $oldname) {
unset($a_threaded[$key]);
- $a_threaded[$newname] = true;
+ $a_threaded[$newname] = $val;
}
else if (preg_match($oldprefix, $key)) {
unset($a_threaded[$key]);
- $a_threaded[preg_replace($oldprefix, $newname.$delimiter, $key)] = true;
+ $a_threaded[preg_replace($oldprefix, $newname.$delimiter, $key)] = $val;
}
}
+
$RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
// #1488692: update session
diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc
index d1449bb38..a054224f1 100644
--- a/program/steps/settings/save_folder.inc
+++ b/program/steps/settings/save_folder.inc
@@ -115,15 +115,13 @@ if (!$error && !strlen($old)) {
if (isset($_POST['_viewmode'])) {
$a_threaded = (array) $RCMAIL->config->get('message_threading', array());
- if ($_POST['_viewmode'])
- $a_threaded[$folder['name']] = true;
- else
- unset($a_threaded[$folder['name']]);
+ $a_threaded[$folder['name']] = (bool) $_POST['_viewmode'];
$RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
}
rcmail_update_folder_row($folder['name'], null, $folder['subscribe'], $folder['class']);
+
$OUTPUT->show_message('foldercreated', 'confirmation');
// reset folder preview frame
$OUTPUT->command('subscription_select');
@@ -167,14 +165,12 @@ else if (!$error) {
}
else if (preg_match($oldprefix, $key)) {
unset($a_threaded[$key]);
- $a_threaded[preg_replace($oldprefix, $folder['name'].$delimiter, $key)] = true;
+ $a_threaded[preg_replace($oldprefix, $folder['name'].$delimiter, $key)] = $val;
}
}
}
- if ($_POST['_viewmode'])
- $a_threaded[$folder['name']] = true;
- else
- unset($a_threaded[$folder['name']]);
+
+ $a_threaded[$folder['name']] = (bool) $_POST['_viewmode'];
$RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
}