X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=05462549a88987a26c702247754b207f4e615640;hb=ca29b81004eea3cff3f249e95235ba544730a4e7;hp=3aa9bdb43385b94a9506b270986776e299f3d32b;hpb=441f2d33bad826a0278aafe63e58d0b3c81b6e0c;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 3aa9bdb4..05462549 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -40,24 +40,33 @@ if ($where && $what) { // Got here from a search echo ""; - } else { + } else { echo ""; } echo ""._("View message") . "\n"; echo "\n"; - echo "
";
+      echo "
"; + + echo ""; for ($i=1; $i < count($read)-1; $i++) { - $read[$i] = htmlspecialchars($read[$i]); - if (substr($read[$i], 0, 1) != "\t" && - substr($read[$i], 0, 1) != " " && - substr($read[$i], 0, 1) != "&" && - trim($read[$i])) { - $pre = substr($read[$i], 0, strpos($read[$i], ":")); - $read[$i] = str_replace("$pre", "$pre", decodeHeader($read[$i])); + $line = htmlspecialchars($read[$i]); + if (eregi("^[ |\t]", $line)) { + $second = $line; + $first = ""; + } else if (eregi("^([^:|^\s]+):(.+)", $line, $regs)) { + $first = $regs[1]; + $second = $regs[2]; + } else { + $second = trim($line); + $first = ""; } - echo "$read[$i]"; + echo ""; } - echo "
"; + if ($first) echo "$first:"; + else echo " "; + echo "$second
\n"; + echo "
"; + echo "\n"; echo ""; sqimap_mailbox_close($imapConnection); sqimap_logout($imapConnection); @@ -69,34 +78,48 @@ // returns the index of the next valid message from the array function findNextMessage() { - global $msort, $currentArrayIndex, $msgs; - for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { - if ($currentArrayIndex == $msgs[$key]["ID"]) { - next($msort); - $key = key($msort); - if (isset($key)) - return $msgs[$key]["ID"]; - } - } + global $msort, $currentArrayIndex, $msgs, $sort; + + if ($sort == 6) { + if ($currentArrayIndex != 1) { + return $currentArrayIndex - 1; + } + } else { + for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { + if ($currentArrayIndex == $msgs[$key]["ID"]) { + next($msort); + $key = key($msort); + if (isset($key)) + return $msgs[$key]["ID"]; + } + } + } return -1; } // returns the index of the previous message from the array function findPreviousMessage() { - global $msort, $currentArrayIndex, $msgs; - for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { - if ($currentArrayIndex == $msgs[$key]["ID"]) { - prev($msort); - $key = key($msort); - if (isset($key)) - return $msgs[$key]["ID"]; - } - } + global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection, $mailbox; + if ($sort == 6) { + $numMessages = sqimap_get_num_messages($imapConnection, $mailbox); + if ($currentArrayIndex != $numMessages) { + return $currentArrayIndex + 1; + } + } else { + for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { + if ($currentArrayIndex == $msgs[$key]["ID"]) { + prev($msort); + $key = key($msort); + if (isset($key)) + return $msgs[$key]["ID"]; + } + } + } return -1; } if (isset($msgs)) { - $currentArrayIndex = $passed_id; + $currentArrayIndex = $passed_id; /* for ($i=0; $i < count($msgs); $i++) { if ($msgs[$i]["ID"] == $passed_id) { @@ -221,6 +244,7 @@ do_hook("read_body_top"); echo "
"; + echo "\n"; echo "
"; echo " "; @@ -237,7 +261,7 @@ if ($where && $what) { echo " "; } else { - echo " "; + echo " "; } echo _("Delete"); echo "  ";