// A recursive function that returns a list of attachments with links
// to where to download these attachments
function formatAttachments ($message, $ent_id, $mailbox, $id) {
+ global $where, $what;
if ($message) {
if (!$message->entities) {
$type0 = strtolower($message->header->type0);
$urlMailbox = urlencode($mailbox);
$ent = urlencode($message->header->entity_id);
- $body .= "<TT> <A HREF=\"../src/download.php?passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A> (TYPE: $type0/$type1)";
+ if ($where && $what) {
+ // from a search
+ $body .= "<TT> <A HREF=\"../src/download.php?where=".urlencode($where)."&what=".urlencode($what)."&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A> (TYPE: $type0/$type1)";
+ } else {
+ $body .= "<TT> <A HREF=\"../src/download.php?passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A> (TYPE: $type0/$type1)";
+ }
if ($message->header->description)
$body .= " <b>" . htmlspecialchars($message->header->description)."</b>";
$body .= " (<a href=\"../src/download.php?absolute_dl=true&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">"._("download")."</a>)\n";