}
for ($i = 0; $i < count($boxes); $i++) {
- if (count($boxes[$i]["flags"]) > 0) {
- $noinf = false;
- for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
- if ($boxes[$i]["flags"][$j] == "noinferiors") {
- $noinf = true;
- continue;
- }
- }
- if ($noinf == false) {
- if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
- $box = $boxes[$i]["unformatted"];
- $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
- echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
- } else {
- $box = $boxes[$i]["unformatted"];
- $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
- if (strtolower($imap_server_type) != "courier" ||
- strtolower($box) != "inbox.trash")
- echo "<OPTION VALUE=\"$box\">$box2\n";
- }
- }
- } else {
+ if (!in_array('noinferiors', $boxes[$i]['flags'])) {
if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
$box = $boxes[$i]["unformatted"];
$box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
else {
for ($i = 0; $i < count($boxes); $i++) {
if ($boxes[$i]["unformatted"] == $trash_folder) {
- $can_move_to_trash = true;
- for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
- if (strtolower($boxes[$i]["flags"][$j]) == "noinferiors")
- $can_move_to_trash = false;
- }
+ $can_move_to_trash = !in_array('noinferiors', $boxes[$i]['flags']);
}
}
}
$line = "";
$mailbox = $boxes[$i]["formatted"];
- if (count($boxes[$i]["flags"])) {
- $noselect = false;
- for ($h = 0; $h < count($boxes[$i]["flags"]); $h++) {
- if (strtolower($boxes[$i]["flags"][$h]) == "noselect")
- $noselect = true;
- }
- if ($noselect == true) {
- $line .= "<FONT COLOR=\"$color[10]\">";
- $line .= replace_spaces($mailbox);
- $line .= "</FONT>";
- } else {
- if (! isset($boxes[$i]["unseen"]))
- $boxes[$i]["unseen"] = 0;
- $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
- }
+ if (in_array('noselect', $boxes[$i]['flags']) {
+ $line .= "<FONT COLOR=\"$color[10]\">";
+ $line .= replace_spaces($mailbox);
+ $line .= '</FONT>';
} else {
- if (!isset($boxes[$i]["unseen"]))
- $boxes[$i]["unseen"] = "";
+ if (! isset($boxes[$i]['unseen']))
+ $boxes[$i]['unseen'] = '';
$line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
}
echo "$line<BR>\n";