X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=60c191516c04de4c7f589c14d09d5789a57cad93;hb=0afa6558539521649f34f1b2a50078503f30e838;hp=292f4b558223126d35998319abec216d921f782d;hpb=8eea5dd306881cc75bf2223f61eb56b738478073;p=squirrelmail.git diff --git a/src/left_main.php b/src/left_main.php index 292f4b55..60c19151 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -1,80 +1,282 @@ - + - -
- - - - - - include("../config/config.php"); - include("../functions/strings.php"); - include("../functions/imap.php"); - include("../functions/mailbox.php"); - - // open a connection on the imap port (143) - $imapConnection = loginToImapServer($username, $key, $imapServerAddress); - - fputs($imapConnection, "1 list \"\" *\n"); - $str = imapReadData($imapConnection); - - echo ""; - echo "\n";
- for ($i = 0;$i < count($str); $i++) {
- $mailbox = Chop($str[$i]);
- $mailbox = findMailboxName($mailbox);
-
- // find the quote at the begining of the mailbox name.
- // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
- $periodCount = countCharInString($mailbox, ".");
- // indent the correct number of spaces.
- for ($j = 0;$j < $periodCount;$j++)
- echo " ";
+ $unseen = 0;
+
+ if (($unseen_notify == 2 && $real_box == "INBOX") ||
+ $unseen_notify == 3) {
+ $unseen = sqimap_unseen_messages($imapConnection, $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 = "($unseen/$numMessages)";
+ $unseen_found = true;
+ }
+ }
- $mailboxURL = urlencode($mailbox);
- echo "";
- echo readShortMailboxName($mailbox, ".");
- if (($move_to_trash == true) && ($mailbox == $trash_folder)) {
- $urlMailbox = urlencode($mailbox);
- selectMailbox($imapConnection, $mailbox, $numNessages);
- echo " (empty)";
+ $special_color = false;
+ if ((strtolower($real_box) == "inbox") ||
+ (($real_box == $trash_folder) && ($move_to_trash)) ||
+ (($real_box == $sent_folder) && ($move_to_sent)))
+ $special_color = true;
+
+ /* Start off with a blank line. */
+ $line = '';
+
+ /* If there are unseen message, bold the line. */
+ if ($unseen > 0) { $line .= ''; }
+
+ /* Crate the link for this folder. */
+ $line .= "";
+ if ($special_color == true)
+ $line .= "";
+ $line .= str_replace(' ',' ',$mailbox);
+ if ($special_color == true)
+ $line .= "";
+ $line .= '';
+
+ /* If there are unseen message, close bolding. */
+ if ($unseen > 0) { $line .= ""; }
+
+ /* Print unseen information. */
+ if (isset($unseen_found) && $unseen_found) {
+ $line .= " $unseen_string";
+ }
+
+ if (($move_to_trash == true) && ($real_box == $trash_folder)) {
+ if (! isset($numMessages)) {
+ $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
+ }
+
+ if ($numMessages > 0) {
+ $urlMailbox = urlencode($real_box);
+ $line .= "\n\n";
+ $line .= " ("._("purge").")";
+ $line .= "\n\n";
+ }
}
- echo "
\n";
+
+ /* Return the final product. */
+ return ($line);
}
- echo "
";
- fclose($imapConnection);
-
+ if (isset($left_refresh) && ($left_refresh != "None") && ($left_refresh != "")) {
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ }
+
+ echo "\n\n";
+
+ do_hook("left_main_before");
+
+ $boxes = sqimap_mailbox_list($imapConnection);
+
+ echo "