-<?
- include("../config/config.php");
- include("../functions/strings.php");
- include("../functions/page_header.php");
- include("../functions/imap.php");
- include("../functions/mime.php");
- include("../functions/mailbox.php");
- include("../functions/date.php");
-
- include("../src/load_prefs.php");
-
- function viewText($color, $body, $id, $entid, $mailbox, $type1) {
- echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
- displayPageHeader($color, "None");
-
- echo "<BR><TABLE WIDTH=90% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
- echo "<B><CENTER>Viewing a plain text attachment</CENTER></B>";
- echo "</TD></TR><TR><TD BGCOLOR=\"$color[4]\">";
+<?php
+
+/**
+ * download.php
+ *
+ * Copyright (c) 1999-2001 The Squirrelmail Development Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Handles attachment downloads to the users computer.
+ * Also allows displaying of attachments when possible.
+ *
+ * $Id$
+ */
+
+/*****************************************************************/
+/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
+/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
+/*** + Base level indent should begin at left margin, as ***/
+/*** the require_once below looks. ***/
+/*** + All identation should consist of four space blocks ***/
+/*** + Tab characters are evil. ***/
+/*** + all comments should use "slash-star ... star-slash" ***/
+/*** style -- no pound characters, no slash-slash style ***/
+/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
+/*** ALWAYS USE { AND } CHARACTERS!!! ***/
+/*** + Please use ' instead of ", when possible. Note " ***/
+/*** should always be used in _( ) function calls. ***/
+/*** Thank you for your help making the SM code more readable. ***/
+/*****************************************************************/
+
+define('download_php', true); // Used for preferences
+
+require_once('../src/validate.php');
+require_once('../functions/imap.php');
+require_once('../functions/mime.php');
+require_once('../functions/date.php');
+
+ header("Pragma: ");
+ header("Cache-Control: cache");
+
+ function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
+ global $where, $what, $charset;
+ global $startMessage;
+
+ displayPageHeader($color, 'None');
+
+ echo "<BR><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
+ echo "<B><CENTER>";
+ echo _("Viewing a text attachment") . " - ";
+ if ($where && $what) {
+ // from a search
+ echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&where=".urlencode($where)."&what=".urlencode($what)."\">". _("View message") . "</a>";
+ } else {
+ echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
+ }
+