function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) {
global $folder_prefix, $trash_folder, $sent_folder;
global $color, $move_to_sent, $move_to_trash;
+ global $unseen_notify, $unseen_type;
$mailboxURL = urlencode($real_box);
- if($real_box=="INBOX") {
+
+ if ($unseen_notify == 2 && $real_box == "INBOX") {
+ $unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box);
+ if ($unseen_type == 1 && $unseen > 0) {
+ $unseen_string = "($unseen)";
+ $unseen_found = true;
+ } else if ($unseen_type == 2) {
+ $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
+ $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
+ $unseen_found = true;
+ }
+ } else if ($unseen_notify == 3) {
$unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box);
- }
+ if ($unseen_type == 1 && $unseen > 0) {
+ $unseen_string = "($unseen)";
+ $unseen_found = true;
+ } else if ($unseen_type == 2) {
+ $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
+ $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
+ $unseen_found = true;
+ }
+ }
$line .= "<NOBR>";
if ($unseen > 0)
if ($unseen > 0)
$line .= "</B>";
- if ($unseen > 0) {
- $line .= " <small>($unseen)</small>";
+ if ($unseen_found) {
+ $line .= " <small>$unseen_string</small>";
}
if (($move_to_trash == true) && ($real_box == $trash_folder)) {
$urlMailbox = urlencode($real_box);
$line .= "\n<small>\n";
- $line .= " (<B><A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A></B>)";
+ $line .= " (<B><A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A></B>)";
$line .= "\n</small>\n";
}
$line .= "</NOBR>";