X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fleft_main.php;h=4a435097d3fe8612aef9d8cac5334af366428c02;hp=39a210efcf72dcd3fd06d563a4d089ff3ae227eb;hb=1195c34026fc65eb8e0ca7a337fe4b406764dee8;hpb=97afcee93eddc98bc09165ae0a5eba0da7b73a8f diff --git a/src/left_main.php b/src/left_main.php index 39a210ef..4a435097 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -1,114 +1,131 @@ - - -"; + if ($unseen > 0) $line .= ""; $special_color = false; - for ($i = 0; $i < count($special_folders); $i++) { - if (($special_folders[$i] == $mailbox) && ($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 .= ""; - $line .= readShortMailboxName($mailbox, $delimeter); + $line .= ""; + $line .= replace_spaces($mailbox); $line .= ""; } else { - $line .= ""; - $line .= readShortMailboxName($mailbox, $delimeter); - $line .= ""; + $line .= ""; + $line .= replace_spaces($mailbox); + $line .= ""; } - if ($unseen) + if ($unseen > 0) $line .= ""; - if ($numUnseen > 0) { - $line .= " ($numUnseen)"; + if ($unseen > 0) { + $line .= " ($unseen)"; } - if (($move_to_trash == true) && (trim($mailbox) == $trash_folder)) { - $urlMailbox = urlencode($mailbox); - $line .= ""; - $line .= "    (empty)"; - $line .= "\n"; + if (($move_to_trash == true) && ($real_box == $trash_folder)) { + $urlMailbox = urlencode($real_box); + $line .= "\n\n"; + $line .= "     ("._("purge").")"; + $line .= "\n\n"; } + $line .= ""; return $line; } - echo ""; - echo ""; // open a connection on the imap port (143) - $imapConnection = loginToImapServer($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 - getFolderList($imapConnection, $boxes); + /** If it was a successful login, lets load their preferences **/ + include("../src/load_prefs.php"); - echo "
"; - echo "Folders
"; + if (isset($left_refresh) && ($left_refresh != "None") && ($left_refresh != "")) { + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "\n\n\n"; - echo "(refresh folder list)

"; - echo "\n"; - $delimeter = findMailboxDelimeter($imapConnection); - for ($i = 0;$i < count($boxes); $i++) { - $mailbox = $boxes[$i]["UNFORMATTED"]; - $boxFlags = getMailboxFlags($boxes[$i]["RAW"]); + $boxes = sqimap_mailbox_list($imapConnection); - $boxCount = countCharInString($mailbox, $delimeter); + echo "
"; + echo _("Folders") . "
\n\n"; + echo "("; + echo _("refresh folder list"); + echo ")

"; + $delimeter = sqimap_get_delimiter($imapConnection); + + for ($i = 0;$i < count($boxes); $i++) { $line = ""; - // indent the correct number of spaces. - for ($j = 0;$j < $boxCount;$j++) - $line .= "  "; + $mailbox = $boxes[$i]["formatted"]; - if (trim($boxFlags[0]) != "") { + if ($boxes[$i]["flags"]) { $noselect = false; - for ($h = 0; $h < count($boxFlags); $h++) { - if (strtolower($boxFlags[$h]) == "noselect") + for ($h = 0; $h < count($boxes[$i]["flags"]); $h++) { + if (strtolower($boxes[$i]["flags"][$h]) == "noselect") $noselect = true; } - if ($noselect == true) { - $line .= ""; - $line .= readShortMailboxName($mailbox, $delimeter); - $line .= ""; + $line .= ""; + $line .= replace_spaces(readShortMailboxName($mailbox, $delimeter)); + $line .= ""; } else { - $line .= formatMailboxName($imapConnection, $mailbox, $delimeter); + $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]); } } else { - $line .= formatMailboxName($imapConnection, $mailbox, $delimeter); + $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]); } - echo "$line
"; + echo "\n$line
\n"; } - echo "
"; - - fclose($imapConnection); - + sqimap_logout($imapConnection); ?> -
+