added some preferences, and squashed soem bugs
[squirrelmail.git] / src / options.php
1 <?
2 include("../config/config.php");
3 include("../functions/mailbox.php");
4 include("../functions/strings.php");
5 include("../functions/page_header.php");
6 include("../functions/display_messages.php");
7 include("../functions/imap.php");
8 include("../functions/array.php");
9
10 include("../src/load_prefs.php");
11
12
13 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
14 getFolderList($imapConnection, $boxes);
15 fputs($imapConnection, "1 logout\n");
16
17 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
18 displayPageHeader($color, "None");
19
20 /** load up some of the values from the pref file **/
21 $fullname = getPref($data_dir, $username, "full_name");
22 $replyto = getPref($data_dir, $username, "reply_to");
23
24 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
25 echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
26 echo " <FONT FACE=\"Arial,Helvetica\">Options</FONT>\n";
27 echo " </TD></TR>\n";
28 echo "</TABLE>\n";
29
30 echo "<FORM action=\"options_submit.php\" METHOD=POST>\n";
31 echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
32 // FULL NAME
33 echo " <TR>";
34 echo " <TD WIDTH=20% ALIGN=RIGHT>";
35 echo " <FONT FACE=\"Arial,Helvetica\">";
36 echo " Full Name:";
37 echo " </FONT>";
38 echo " </TD>";
39 echo " <TD WIDTH=80% ALIGN=LEFT>";
40 echo " <FONT FACE=\"Arial,Helvetica\">";
41 echo " <INPUT TYPE=TEXT NAME=full_name VALUE=\"$fullname\" SIZE=50><BR>";
42 echo " </FONT>";
43 echo " </TD>";
44 echo " </TR>";
45 // REPLY-TO
46 echo " <TR>";
47 echo " <TD WIDTH=20% ALIGN=RIGHT>";
48 echo " <FONT FACE=\"Arial,Helvetica\">";
49 echo " Reply-to:";
50 echo " </FONT>";
51 echo " </TD>";
52 echo " <TD WIDTH=80% ALIGN=LEFT>";
53 echo " <FONT FACE=\"Arial,Helvetica\">";
54 echo " <INPUT TYPE=TEXT NAME=reply_to VALUE=\"$replyto\" SIZE=50><BR>";
55 echo " </FONT>";
56 echo " </TD>";
57 echo " </TR>";
58 // THEME
59 echo " <TR>";
60 echo " <TD WIDTH=20% ALIGN=RIGHT>";
61 echo " <FONT FACE=\"Arial,Helvetica\">";
62 echo " Theme:";
63 echo " </FONT>";
64 echo " </TD>";
65 echo " <TD WIDTH=80% ALIGN=LEFT>";
66
67 echo " <TT><SELECT NAME=chosentheme>\n";
68 for ($i = 0; $i < count($theme); $i++) {
69 if ($theme[$i]["PATH"] == $chosen_theme)
70 echo " <OPTION SELECTED VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
71 else
72 echo " <OPTION VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
73 }
74 echo " </SELECT></TT>";
75 echo " </TD>";
76 echo " </TR>";
77 echo "</TABLE>";
78
79
80
81 echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
82 // MOVE_TO_TRASH
83 echo " <TR>";
84 echo " <TD WIDTH=60% ALIGN=RIGHT>";
85 echo " <FONT FACE=\"Arial,Helvetica\">";
86 echo " Move deleted messages to \"$trash_folder\"?";
87 echo " </FONT>";
88 echo " </TD>";
89 echo " <TD WIDTH=40% ALIGN=LEFT>";
90 echo " <FONT FACE=\"Arial,Helvetica\">";
91 if ($move_to_trash == true)
92 echo " <INPUT TYPE=RADIO NAME=movetotrash VALUE=1 CHECKED>&nbsp;True<BR>";
93 else
94 echo " <INPUT TYPE=RADIO NAME=movetotrash VALUE=1>&nbsp;True<BR>";
95
96 if ($move_to_trash == false)
97 echo " <INPUT TYPE=RADIO NAME=movetotrash VALUE=0 CHECKED>&nbsp;False";
98 else
99 echo " <INPUT TYPE=RADIO NAME=movetotrash VALUE=0>&nbsp;False";
100
101 echo " </FONT>";
102 echo " </TD>";
103 echo " </TR>";
104
105 // WRAP_AT
106 echo " <TR>";
107 echo " <TD WIDTH=60% ALIGN=RIGHT>";
108 echo " <FONT FACE=\"Arial,Helvetica\">";
109 echo " Wrap incoming text at:";
110 echo " </FONT>";
111 echo " </TD>";
112 echo " <TD WIDTH=40% ALIGN=LEFT>";
113 echo " <FONT FACE=\"Arial,Helvetica\">";
114 if (isset($wrap_at))
115 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=wrapat VALUE=\"$wrap_at\"></TT><BR>";
116 else
117 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=wrapat VALUE=\"86\"></TT><BR>";
118 echo " </FONT>";
119 echo " </TD>";
120 echo " </TR>";
121
122 // EDITOR_SIZE
123 echo " <TR>";
124 echo " <TD WIDTH=60% ALIGN=RIGHT>";
125 echo " <FONT FACE=\"Arial,Helvetica\">";
126 echo " Size of editor window (in characters):";
127 echo " </FONT>";
128 echo " </TD>";
129 echo " <TD WIDTH=40% ALIGN=LEFT>";
130 echo " <FONT FACE=\"Arial,Helvetica\">";
131 if (isset($editor_size))
132 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"$editor_size\"></TT><BR>";
133 else
134 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"76\"></TT><BR>";
135 echo " </FONT>";
136 echo " </TD>";
137 echo " </TR>";
138 echo "</TABLE>";
139
140
141 // SUBMIT BUTTON
142 echo "<BR><CENTER><INPUT TYPE=SUBMIT VALUE=\"Submit\"></CENTER>\n";
143 echo "</FORM>";
144
145 echo "</BODY></HTML>";
146 ?>