From c5a52f46d793662080fa492137daf13b25dddee7 Mon Sep 17 00:00:00 2001 From: jangliss Date: Mon, 13 Oct 2003 19:15:11 +0000 Subject: [PATCH] Advanced mailbox (oldway and advancedtree) mode wasn't respecting the default values in the config.php file for unseen notifications. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5935 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/left_main.php | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/left_main.php b/src/left_main.php index 4e9eab76..0f13c1d5 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -287,18 +287,13 @@ function is_parent_box($curbox_name, $parbox_name) { function ListBoxes ($boxes, $j=0 ) { global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type, - $move_to_trash, $trash_folder, $collapse_folders, $imapConnection; + $move_to_trash, $trash_folder, $collapse_folders, $imapConnection; + $pre = ''; $end = ''; $collapse = false; - $unseen_type = 1; - $unseen_notify = 0; $unseen = 0; - /* Get unseen/total display prefs */ - $unseen_type = getPref( $data_dir , $username , 'unseen_type' ); - $unseen_notify = getPref( $data_dir , $username , 'unseen_notify' ); - if (isset($boxes) && !empty($boxes)) { $mailbox = $boxes->mailboxname_full; $leader = ''; @@ -431,7 +426,7 @@ function ListBoxes ($boxes, $j=0 ) { function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) { global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type, - $move_to_trash, $trash_folder, $collapse_folders, $oldway, $advanced_tree; + $move_to_trash, $trash_folder, $collapse_folders; if (!$boxes) return; @@ -991,6 +986,26 @@ if ( $collapse_folders ) { } } +/* Get unseen/total display prefs */ +$unseen_type = getPref( $data_dir , $username , 'unseen_type' ); +$unseen_notify = getPref( $data_dir , $username , 'unseen_notify' ); + +if (!isset($unseen_type) || empty($unseen_type)) { + if (isset($default_unseen_type) && !empty($default_unseen_type)) { + $unseen_type = $default_unseen_type; + } else { + $unseen_type = 1; + } +} + +if (!isset($unseen_notify) || empty($unseen_notify)) { + if (isset($default_unseen_notify) && !empty($default_unseen_notify)) { + $unseen_notify = $default_unseen_notify; + } else { + $unseen_notify = 0; + } +} + if ($oldway) { /* normal behaviour SM */ $boxes = sqimap_mailbox_list($imapConnection); -- 2.25.1