X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=a6702f23d4ca2082d4a057ac27f067bb647102bc;hb=e146912692c921160f93dcb6da97dc6246bf95d2;hp=39a210efcf72dcd3fd06d563a4d089ff3ae227eb;hpb=97afcee93eddc98bc09165ae0a5eba0da7b73a8f;p=squirrelmail.git
diff --git a/src/left_main.php b/src/left_main.php
index 39a210ef..a6702f23 100644
--- a/src/left_main.php
+++ b/src/left_main.php
@@ -11,38 +11,44 @@
echo "You need a valid user and password to access this page!";
exit;
}
-?>
-
-
- include("../config/config.php");
- include("../functions/array.php");
- include("../functions/strings.php");
- include("../functions/imap.php");
- include("../functions/mailbox.php");
- function formatMailboxName($imapConnection, $mailbox, $delimeter) {
+ if (!isset($config_php))
+ include("../config/config.php");
+ if (!isset($array_php))
+ include("../functions/array.php");
+ if (!isset($strings_php))
+ include("../functions/strings.php");
+ if (!isset($imap_php))
+ include("../functions/imap.php");
+ if (!isset($page_header_php))
+ include("../functions/page_header.php");
+
+ echo "";
+
+ function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $color, $move_to_trash) {
require ("../config/config.php");
- $mailboxURL = urlencode($mailbox);
- selectMailbox($imapConnection, $mailbox, $numNessages);
- $unseen = unseenMessages($imapConnection, $numUnseen);
+ $mailboxURL = urlencode($real_box);
+ sqimap_mailbox_select ($imapConnection, $real_box);
+ $unseen = sqimap_unseen_messages($imapConnection, $numUnseen);
+ echo "";
if ($unseen)
$line .= "";
$special_color = false;
for ($i = 0; $i < count($special_folders); $i++) {
- if (($special_folders[$i] == $mailbox) && ($use_special_folder_color == true))
+ if (($special_folders[$i] == $real_box) && ($use_special_folder_color == true))
$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 .= replace_spaces($mailbox);
$line .= "";
}
@@ -50,65 +56,68 @@
$line .= "";
if ($numUnseen > 0) {
- $line .= " ($numUnseen)";
+ $line .= " ($numUnseen)";
}
- if (($move_to_trash == true) && (trim($mailbox) == $trash_folder)) {
- $urlMailbox = urlencode($mailbox);
- $line .= "";
- $line .= " (empty)";
- $line .= "\n";
+ if (($move_to_trash == true) && (trim($real_box) == $trash_folder)) {
+ $urlMailbox = urlencode($real_box);
+ $line .= "";
+ $line .= " ("._("purge").")";
+ $line .= "\n";
}
+
+ echo "";
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
-
- getFolderList($imapConnection, $boxes);
+ $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 "";
+ echo "";
+ }
+
+ echo "";
- echo "";
- echo "Folders
";
+ $boxes = sqimap_mailbox_list($imapConnection);
- 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"]);
+ echo "";
+ echo _("Folders") . "
";
- $boxCount = countCharInString($mailbox, $delimeter);
+ 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, $color, $move_to_trash);
}
} else {
- $line .= formatMailboxName($imapConnection, $mailbox, $delimeter);
+ $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $color, $move_to_trash);
}
echo "$line
";
}
- echo "";
fclose($imapConnection);
?>
-
+