X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=c8bc624aa7411bed2e8ed2e7e22318c46236c61b;hb=e1c11171cd580d0d27e1a596ab53afac90075bf3;hp=0778297094589addb4a35a6d10b112b3a86c274b;hpb=aae41ae986d847f7bb15d98f98e16bc65595f215;p=squirrelmail.git diff --git a/src/left_main.php b/src/left_main.php index 07782970..c8bc624a 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -1,4 +1,4 @@ - - -"; - function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $color, $move_to_trash) { - require ("../config/config.php"); + function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) { + global $folder_prefix, $trash_folder, $sent_folder; + global $color, $move_to_sent, $move_to_trash; $mailboxURL = urlencode($real_box); - sqimap_mailbox_select ($imapConnection, $real_box); - $unseen = sqimap_unseen_messages($imapConnection, $numUnseen); + if($real_box=="INBOX") { + $unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box); + } echo ""; - if ($unseen) + if ($unseen > 0) $line .= ""; $special_color = false; - for ($i = 0; $i < count($special_folders); $i++) { - if (($special_folders[$i] == $real_box) && ($use_special_folder_color == true)) - $special_color = true; - } + if ((strtolower($real_box) == "inbox") || + (($real_box == $trash_folder) && ($move_to_trash)) || + (($real_box == $sent_folder) && ($move_to_sent))) + $special_color = true; if ($special_color == true) { $line .= ""; @@ -50,29 +59,29 @@ $line .= ""; } - if ($unseen) + if ($unseen > 0) $line .= ""; - if ($numUnseen > 0) { - $line .= " ($numUnseen)"; + if ($unseen > 0) { + $line .= " ($unseen)"; } - if (($move_to_trash == true) && (trim($real_box) == $trash_folder)) { + if (($move_to_trash == true) && ($real_box == $trash_folder)) { $urlMailbox = urlencode($real_box); $line .= ""; $line .= "    ("._("purge").")"; $line .= "\n"; } - - echo ""; return $line; + echo ""; } // open a connection on the imap port (143) - $imapConnection = sqimap_login($username, $key, $imapServerAddress, 10); // the 10 is to hide the output + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output /** If it was a successful login, lets load their preferences **/ include("../src/load_prefs.php"); + if (isset($left_refresh) && ($left_refresh != "None") && ($left_refresh != "")) { echo ""; echo ""; @@ -106,10 +115,10 @@ $line .= replace_spaces(readShortMailboxName($mailbox, $delimeter)); $line .= ""; } else { - $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $color, $move_to_trash); + $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]); } } else { - $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $color, $move_to_trash); + $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]); } echo "$line
"; }