added some preferences, and squashed soem bugs
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 7 Jan 2000 15:55:39 +0000 (15:55 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 7 Jan 2000 15:55:39 +0000 (15:55 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@122 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php
src/download.php
src/left_main.php
src/load_prefs.php
src/options.php
src/options_submit.php
src/read_body.php

index ec97c74..d0a6cc3 100644 (file)
    echo "   </TR>\n";
    echo "   <TR>\n";
    echo "      <TD BGCOLOR=\"$color[4]\" COLSPAN=2>\n";
-   echo "         &nbsp;&nbsp;<TEXTAREA NAME=passed_body ROWS=20 COLS=76 WRAP=HARD>$body</TEXTAREA><BR>";
+   echo "         &nbsp;&nbsp;<TEXTAREA NAME=passed_body ROWS=20 COLS=\"$editor_size\" WRAP=HARD>$body</TEXTAREA><BR>";
    echo "      </TD>";
    echo "   </TR>\n";
    echo "</TABLE>\n";
index 480b694..b89fced 100644 (file)
@@ -9,7 +9,7 @@
 
    include("../src/load_prefs.php");
 
-   function viewText($color, $body, $id, $entid, $mailbox, $type1) {
+   function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
       echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
       displayPageHeader($color, "None");
 
@@ -19,9 +19,9 @@
       $urlmailbox = urlencode($mailbox);
       echo "<FONT FACE=\"Arial, Helvetica\"><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">Download this as a file</A></CENTER><BR><BR></FONT><TT>";
       if ($type1 == "html")
-         echo nl2br(trim($body));
+         echo $body;
       else
-         echo nl2br(trim(htmlspecialchars($body)));
+         echo translateText($body, $wrap_at);
 
       echo "</TT></TD></TR></TABLE>";
    }
       switch ($type0) {
          case "text":
             $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
-            viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1);
+            viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1, $wrap_at);
             break;
          case "message":
             $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
-            viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1);
+            viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1, $wrap_at);
             break;
          default:
             $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
index 6558954..642717b 100644 (file)
@@ -20,7 +20,7 @@
    include("../functions/imap.php");
    include("../functions/mailbox.php");
 
-   function formatMailboxName($imapConnection, $mailbox, $delimeter, $color) {
+   function formatMailboxName($imapConnection, $mailbox, $delimeter, $color, $move_to_trash) {
       require ("../config/config.php");
 
       $mailboxURL = urlencode($mailbox);
             $line .= readShortMailboxName($mailbox, $delimeter);
             $line .= "</FONT><FONT FACE=\"Arial,Helvetica\">";
          } else {
-            $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color);
+            $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color, $move_to_trash);
          }
       } else {
-         $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color);
+         $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color, $move_to_trash);
       }
       echo "$line<BR>";
    }
index e302658..e36482a 100644 (file)
          exit;
       }
    }
-?>
\ No newline at end of file
+
+
+   /** Load the user's trash folder preferences **/
+   $move_to_trash = getPref($data_dir, $username, "move_to_trash");
+   if ($move_to_trash == "")
+      $move_to_trash = $default_move_to_trash;
+
+   $wrap_at = getPref($data_dir, $username, "wrap_at");
+   if ($wrap_at == "")
+      $wrap_at = 86;
+
+   $editor_size = getPref($data_dir, $username, "editor_size");
+   if ($editor_size == "")
+      $editor_size = 76;
+?>
+
index 362a22a..af6cd87 100644 (file)
    include("../src/load_prefs.php");
 
 
+   $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
+   getFolderList($imapConnection, $boxes);
+   fputs($imapConnection, "1 logout\n");
+
    echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
    displayPageHeader($color, "None");
 
    echo "         </SELECT></TT>";
    echo "      </TD>";
    echo "   </TR>";
+   echo "</TABLE>";
 
-   echo "</SELECT></TT>\n";
 
 
-   // SUBMIT BUTTON
+   echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
+   // MOVE_TO_TRASH
    echo "   <TR>";
-   echo "      <TD WIDTH=20%>";
+   echo "      <TD WIDTH=60% ALIGN=RIGHT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         Move deleted messages to \"$trash_folder\"?";
+   echo "         </FONT>";
    echo "      </TD>";
-   echo "      <TD WIDTH=80% ALIGN=LEFT>";
-   echo "         <BR><INPUT TYPE=SUBMIT VALUE=\"Submit\">\n";
+   echo "      <TD WIDTH=40% ALIGN=LEFT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   if ($move_to_trash == true)
+      echo "         <INPUT TYPE=RADIO NAME=movetotrash VALUE=1 CHECKED>&nbsp;True<BR>";
+   else
+      echo "         <INPUT TYPE=RADIO NAME=movetotrash VALUE=1>&nbsp;True<BR>";
+
+   if ($move_to_trash == false)
+      echo "         <INPUT TYPE=RADIO NAME=movetotrash VALUE=0 CHECKED>&nbsp;False";
+   else
+      echo "         <INPUT TYPE=RADIO NAME=movetotrash VALUE=0>&nbsp;False";
+
+   echo "         </FONT>";
    echo "      </TD>";
    echo "   </TR>";
 
-   echo "</TABLE>\n";
+   // WRAP_AT
+   echo "   <TR>";
+   echo "      <TD WIDTH=60% ALIGN=RIGHT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         Wrap incoming text at:";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "      <TD WIDTH=40% ALIGN=LEFT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   if (isset($wrap_at))
+      echo "         <TT><INPUT TYPE=TEXT SIZE=5 NAME=wrapat VALUE=\"$wrap_at\"></TT><BR>";
+   else
+      echo "         <TT><INPUT TYPE=TEXT SIZE=5 NAME=wrapat VALUE=\"86\"></TT><BR>";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "   </TR>";
+
+   // EDITOR_SIZE
+   echo "   <TR>";
+   echo "      <TD WIDTH=60% ALIGN=RIGHT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         Size of editor window (in characters):";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "      <TD WIDTH=40% ALIGN=LEFT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   if (isset($editor_size))
+      echo "         <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"$editor_size\"></TT><BR>";
+   else
+      echo "         <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"76\"></TT><BR>";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "   </TR>";
+   echo "</TABLE>";
+
+
+   // SUBMIT BUTTON
+   echo "<BR><CENTER><INPUT TYPE=SUBMIT VALUE=\"Submit\"></CENTER>\n";
    echo "</FORM>";
 
    echo "</BODY></HTML>";
index 65b8c20..cbddf1f 100644 (file)
@@ -16,6 +16,9 @@
    setPref($data_dir, $username, "full_name", $full_name);
    setPref($data_dir, $username, "reply_to", $reply_to);
    setPref($data_dir, $username, "chosen_theme", $chosentheme);
+   setPref($data_dir, $username, "move_to_trash", $movetotrash);
+   setPref($data_dir, $username, "wrap_at", $wrapat);
+   setPref($data_dir, $username, "editor_size", $editorsize);
 
    echo "<FONT FACE=\"Arial,Helvetica\">";
    echo "<BR><BR><BR><CENTER><B>Options Saved!</B><BR><BR>";
index 61c31d2..c20a455 100644 (file)
    echo "   </TD></TR>";
 
    echo "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
-   $body = formatBody($message, $color);
+   $body = formatBody($message, $color, $wrap_at);
    echo "<BR>";
 
    echo "$body";