Made some more changes to the received line.
[squirrelmail.git] / src / options.php
CommitLineData
59177427 1<?php
ef870322 2 /**
3 ** options.php
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** Displays the options page. Pulls from proper user preference files
9 ** and config.php. Displays preferences as selected and other options.
10 **
11 **/
12
2a32fc83 13 session_start();
14
d068c0ec 15 if (!isset($config_php))
16 include("../config/config.php");
17 if (!isset($strings_php))
18 include("../functions/strings.php");
19 if (!isset($page_header_php))
20 include("../functions/page_header.php");
21 if (!isset($display_messages_php))
22 include("../functions/display_messages.php");
23 if (!isset($imap_php))
24 include("../functions/imap.php");
25 if (!isset($array_php))
26 include("../functions/array.php");
d30d79f2 27 if (!isset($i18n_php))
28 include("../functions/i18n.php");
d3cdb279 29
30 include("../src/load_prefs.php");
31
65b14f90 32
e1469126 33 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort);
813eba2f 34 $boxes = sqimap_mailbox_list($imapConnection, $boxes);
11307a4c 35 fputs($imapConnection, "1 logout\n");
36
65b14f90 37 displayPageHeader($color, "None");
38
99259b46 39 /** load up some of the values from the pref file **/
d0747e26 40 $fullname = getPref($data_dir, $username, "full_name");
f3585c1a 41 $replyto = getPref($data_dir, $username, "reply_to");
42 $email_address = getPref($data_dir, $username, "email_address");
d30d79f2 43 $chosen_language = getPref($data_dir, $username, "language");
99259b46 44
65b14f90 45 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
46 echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
a6668eb2 47 echo _("Options");
65b14f90 48 echo " </TD></TR>\n";
49 echo "</TABLE>\n";
50
9f2215a1 51 echo "<FORM action=\"options_submit.php\" METHOD=POST>\n";
99259b46 52 echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
53 // FULL NAME
54 echo " <TR>";
d3cdb279 55 echo " <TD WIDTH=20% ALIGN=RIGHT>";
f3585c1a 56 echo _("Full Name:");
99259b46 57 echo " </TD>";
58 echo " <TD WIDTH=80% ALIGN=LEFT>";
b4da6659 59 echo " <INPUT TYPE=TEXT NAME=full_name VALUE=\"$fullname\" SIZE=50><BR>";
99259b46 60 echo " </TD>";
61 echo " </TR>";
f3585c1a 62 // FROM-ADDRESS
63 echo " <TR>";
64 echo " <TD WIDTH=20% ALIGN=RIGHT>";
f3585c1a 65 echo _("E-mail address:");
f3585c1a 66 echo " </TD>";
67 echo " <TD WIDTH=80% ALIGN=LEFT>";
f3585c1a 68 echo " <INPUT TYPE=TEXT NAME=email_address VALUE=\"$email_address\" SIZE=50><BR>";
f3585c1a 69 echo " </TD>";
70 echo " </TR>";
99259b46 71 // REPLY-TO
72 echo " <TR>";
d3cdb279 73 echo " <TD WIDTH=20% ALIGN=RIGHT>";
f3585c1a 74 echo _("Reply-to:");
99259b46 75 echo " </TD>";
76 echo " <TD WIDTH=80% ALIGN=LEFT>";
b4da6659 77 echo " <INPUT TYPE=TEXT NAME=reply_to VALUE=\"$replyto\" SIZE=50><BR>";
99259b46 78 echo " </TD>";
79 echo " </TR>";
37df47f5 80 // DEFAULT FOLDERS
81 if ($show_prefix_option == true) {
82 echo " <TR>";
83 echo " <TD WIDTH=20% ALIGN=RIGHT>";
84 echo _("Folder path:");
85 echo " </TD>";
86 echo " <TD WIDTH=80% ALIGN=LEFT>";
87 if (isset ($folder_prefix))
88 echo " <INPUT TYPE=TEXT NAME=folderprefix VALUE=\"$folder_prefix\" SIZE=50><BR>";
89 else
90 echo " <INPUT TYPE=TEXT NAME=folderprefix VALUE=\"$default_folder_prefix\" SIZE=50><BR>";
91 echo " </TD>";
92 echo " </TR>";
93 }
d3cdb279 94 // THEME
95 echo " <TR>";
96 echo " <TD WIDTH=20% ALIGN=RIGHT>";
f3585c1a 97 echo _("Theme:");
d3cdb279 98 echo " </TD>";
99 echo " <TD WIDTH=80% ALIGN=LEFT>";
100
101 echo " <TT><SELECT NAME=chosentheme>\n";
102 for ($i = 0; $i < count($theme); $i++) {
103 if ($theme[$i]["PATH"] == $chosen_theme)
104 echo " <OPTION SELECTED VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
105 else
106 echo " <OPTION VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
107 }
108 echo " </SELECT></TT>";
109 echo " </TD>";
110 echo " </TR>";
d30d79f2 111 // LANGUAGE
112 echo " <TR>";
113 echo " <TD WIDTH=20% ALIGN=RIGHT>";
d30d79f2 114 echo _("Language:");
d30d79f2 115 echo " </TD>";
116 echo " <TD WIDTH=80% ALIGN=LEFT>";
117
118 echo " <TT><SELECT NAME=language>\n";
e8816411 119 reset ($languages);
120 while (list($code, $name)=each($languages)) {
121 if ($code==$chosen_language)
122 echo " <OPTION SELECTED VALUE=\"".$code."\">".$languages[$code]["NAME"]."\n";
d30d79f2 123 else
e8816411 124 echo " <OPTION VALUE=\"".$code."\">".$languages[$code]["NAME"]."\n";
125
d30d79f2 126 }
127 echo " </SELECT></TT>";
e8816411 128
d30d79f2 129 echo " </TD>";
130 echo " </TR>";
d3cdb279 131
d3cdb279 132
1e0628fb 133 // TRASH FOLDER
1e0628fb 134 echo "<tr><td align=right>";
135 echo _("Trash Folder:");
136 echo "</td><td>";
137 echo "<TT><SELECT NAME=trash>\n";
138 if ($move_to_trash == true)
139 echo "<option value=none>" . _("Don't use Trash");
140 else
141 echo "<option value=none selected>" . _("Do not use Trash");
142
143 for ($i = 0; $i < count($boxes); $i++) {
144 $use_folder = true;
145 if (strtolower($boxes[$i]["unformatted"]) == "inbox") {
146 $use_folder = false;
147 }
148 if ($use_folder == true) {
149 $box = $boxes[$i]["unformatted-dm"];
150 $box2 = replace_spaces($boxes[$i]["formatted"]);
151 if (($boxes[$i]["unformatted"] == $trash_folder) && ($move_to_trash == true))
152 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
153 else
154 echo " <OPTION VALUE=\"$box\">$box2\n";
155 }
156 }
157 echo "</SELECT></TT>\n";
158 echo "</td></tr>";
159
160 // SENT FOLDER
1e0628fb 161 echo "<tr><td align=right>";
162 echo _("Sent Folder:");
163 echo "</td><td>";
164 echo "<TT><SELECT NAME=sent>\n";
165 if ($move_to_sent == true)
166 echo "<option value=none>" . _("Don't use Sent");
167 else
168 echo "<option value=none selected>" . _("Do not use Sent");
169
170 for ($i = 0; $i < count($boxes); $i++) {
171 $use_folder = true;
172 if (strtolower($boxes[$i]["unformatted"]) == "inbox") {
173 $use_folder = false;
174 }
175 if ($use_folder == true) {
176 $box = $boxes[$i]["unformatted-dm"];
177 $box2 = replace_spaces($boxes[$i]["formatted"]);
178 if (($boxes[$i]["unformatted"] == $sent_folder) && ($move_to_sent == true))
179 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
180 else
181 echo " <OPTION VALUE=\"$box\">$box2\n";
182 }
183 }
184 echo "</SELECT></TT>\n";
185 echo "</td></tr>";
d3cdb279 186
11307a4c 187
1e0628fb 188 echo "</TABLE>";
11307a4c 189
3806fa52 190 echo "<table width=1% cols=2 align=center>\n";
191 echo " <tr>\n";
192 echo " <td nowrap align=center>\n";
193 echo " " . _("Use javascript version of address book?") . "\n";
194 echo " </td>\n";
195 echo " </tr>\n";
196 echo " <tr>\n";
197 echo " <td align=left>\n";
198 if ($use_javascript_addr_book == true) {
199 echo " <input type=radio name=javascript_abook value=1 checked> &nbsp;&nbsp;" . _("Yes") . "<br>";
200 echo " <input type=radio name=javascript_abook value=0> &nbsp;&nbsp;" . _("No") . "<br>";
201 } else {
202 echo " <input type=radio name=javascript_abook value=1> &nbsp;&nbsp;" . _("Yes") . "<br>";
203 echo " <input type=radio name=javascript_abook value=0 checked> &nbsp;&nbsp;" . _("No") . "<br>";
204 }
205 echo " </td>\n";
206 echo " </tr>\n";
207 echo "</table>\n";
208
1e0628fb 209 echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
99259b46 210
9c83f905 211 // SHOW_NUM
212 echo " <TR>";
213 echo " <TD WIDTH=60% ALIGN=RIGHT>";
214 echo _("Number of Messages to Index:");
215 echo " </TD>";
216 echo " <TD WIDTH=40% ALIGN=LEFT>";
217 if (isset($wrap_at))
218 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=shownum VALUE=\"$show_num\"></TT><BR>";
219 else
220 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=shownum VALUE=\"25\"></TT><BR>";
221 echo " </TD>";
222 echo " </TR>";
223
11307a4c 224 // WRAP_AT
225 echo " <TR>";
226 echo " <TD WIDTH=60% ALIGN=RIGHT>";
f3585c1a 227 echo _("Wrap incoming text at:");
11307a4c 228 echo " </TD>";
229 echo " <TD WIDTH=40% ALIGN=LEFT>";
11307a4c 230 if (isset($wrap_at))
231 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=wrapat VALUE=\"$wrap_at\"></TT><BR>";
232 else
233 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=wrapat VALUE=\"86\"></TT><BR>";
11307a4c 234 echo " </TD>";
235 echo " </TR>";
236
237 // EDITOR_SIZE
238 echo " <TR>";
239 echo " <TD WIDTH=60% ALIGN=RIGHT>";
f3585c1a 240 echo _("Size of editor window (in characters):");
11307a4c 241 echo " </TD>";
242 echo " <TD WIDTH=40% ALIGN=LEFT>";
f804972b 243 if ($editor_size >= 5)
11307a4c 244 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"$editor_size\"></TT><BR>";
245 else
246 echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"76\"></TT><BR>";
11307a4c 247 echo " </TD>";
248 echo " </TR>";
11307a4c 249
2848c630 250 // LEFT_SIZE
251 echo " <TR>";
252 echo " <td width=60% align=right>";
253 echo _("Width of left folder list:");
254 echo " </td>";
255 echo " <td width=60% align=left>\n";
256 echo " <select name=leftsize>\n";
257 if ($left_size == 100)
258 echo "<option value=100 selected>100 pixels\n";
259 else
260 echo "<option value=100>100 pixels\n";
261
262 if ($left_size == 125)
263 echo "<option value=125 selected>125 pixels\n";
264 else
265 echo "<option value=125>125 pixels\n";
266
267 if ($left_size == 150)
268 echo "<option value=150 selected>150 pixels\n";
269 else
270 echo "<option value=150>150 pixels\n";
271
272 if ($left_size == 175)
273 echo "<option value=175 selected>175 pixels\n";
274 else
275 echo "<option value=175>175 pixels\n";
276
277 if (($left_size == 200) || ($left_size == ""))
278 echo "<option value=200 selected>200 pixels\n";
279 else
280 echo "<option value=200>200 pixels\n";
281
282 if (($left_size == 225))
283 echo "<option value=225 selected>225 pixels\n";
284 else
285 echo "<option value=225>225 pixels\n";
286
287 if (($left_size == 250))
288 echo "<option value=250 selected>250 pixels\n";
289 else
290 echo "<option value=250>250 pixels\n";
291
292 if ($left_size == 275)
293 echo "<option value=275 selected>275 pixels\n";
294 else
295 echo "<option value=275>275 pixels\n";
296
297 if (($left_size == 300))
298 echo "<option value=300 selected>300 pixels\n";
299 else
300 echo "<option value=300>300 pixels\n";
301
302 echo " </select>";
303 echo " </td>";
304 echo " </TR>";
305
306
469eb37b 307 // LEFT_REFRESH
308 echo " <TR>";
309 echo " <TD WIDTH=60% ALIGN=RIGHT>";
f3585c1a 310 echo _("Time between auto refresh of folder list:");
469eb37b 311 echo " </TD>";
312 echo " <TD WIDTH=40% ALIGN=LEFT>";
469eb37b 313 echo " <SELECT name=leftrefresh>";
314 if (($left_refresh == "None") || ($left_refresh == ""))
315 echo " <OPTION VALUE=None SELECTED>None";
316 else
317 echo " <OPTION VALUE=None>None";
318
319 if (($left_refresh == "10"))
320 echo " <OPTION VALUE=10 SELECTED>10 Seconds";
321 else
322 echo " <OPTION VALUE=10>10 Seconds";
323
324 if (($left_refresh == "20"))
325 echo " <OPTION VALUE=20 SELECTED>20 Seconds";
326 else
327 echo " <OPTION VALUE=20>20 Seconds";
328
329 if (($left_refresh == "30"))
330 echo " <OPTION VALUE=30 SELECTED>30 Seconds";
331 else
332 echo " <OPTION VALUE=30>30 Seconds";
333
334 if (($left_refresh == "60"))
335 echo " <OPTION VALUE=60 SELECTED>1 Minute";
336 else
337 echo " <OPTION VALUE=60>1 Minute";
338
339 if (($left_refresh == "120"))
340 echo " <OPTION VALUE=120 SELECTED>2 Minutes";
341 else
342 echo " <OPTION VALUE=120>2 Minutes";
343
344 if (($left_refresh == "180"))
345 echo " <OPTION VALUE=180 SELECTED>3 Minutes";
346 else
347 echo " <OPTION VALUE=180>3 Minutes";
348
349 if (($left_refresh == "240"))
350 echo " <OPTION VALUE=240 SELECTED>4 Minutes";
351 else
352 echo " <OPTION VALUE=240>4 Minutes";
353
354 if (($left_refresh == "300"))
355 echo " <OPTION VALUE=300 SELECTED>5 Minutes";
356 else
357 echo " <OPTION VALUE=300>5 Minutes";
358
359 if (($left_refresh == "420"))
360 echo " <OPTION VALUE=420 SELECTED>7 Minutes";
361 else
362 echo " <OPTION VALUE=420>7 Minutes";
363
364 if (($left_refresh == "600"))
365 echo " <OPTION VALUE=600 SELECTED>10 Minutes";
366 else
367 echo " <OPTION VALUE=600>10 Minutes";
368
369 if (($left_refresh == "720"))
370 echo " <OPTION VALUE=720 SELECTED>12 Minutes";
371 else
372 echo " <OPTION VALUE=720>12 Minutes";
373
374 if (($left_refresh == "900"))
375 echo " <OPTION VALUE=900 SELECTED>15 Minutes";
376 else
377 echo " <OPTION VALUE=900>15 Minutes";
378
379 if (($left_refresh == "1200"))
380 echo " <OPTION VALUE=1200 SELECTED>20 Minutes";
381 else
382 echo " <OPTION VALUE=1200>20 Minutes";
383
384 if (($left_refresh == "1500"))
385 echo " <OPTION VALUE=1500 SELECTED>25 Minutes";
386 else
387 echo " <OPTION VALUE=1500>25 Minutes";
388
389 if (($left_refresh == "1800"))
390 echo " <OPTION VALUE=1800 SELECTED>30 Minutes";
391 else
392 echo " <OPTION VALUE=1800>30 Minutes";
393
394 echo " </SELECT>";
469eb37b 395 echo " </TD>";
396 echo " </TR>";
397 echo "</TABLE>";
398
f804972b 399 // SIGNATURE
400 echo "<CENTER>";
401 if ($use_signature == true)
402 echo "<INPUT TYPE=CHECKBOX VALUE=\"1\" NAME=usesignature CHECKED>&nbsp;&nbsp;Use a signature?<BR>";
cd3db000 403 else {
a6668eb2 404 echo "<INPUT TYPE=CHECKBOX VALUE=\"1\" NAME=usesignature>&nbsp;&nbsp;";
405 echo _("Use a signature?");
406 echo "<BR>";
cd3db000 407 }
f804972b 408
409 if ($editor_size < 5)
410 $sig_size = 76;
411 else
412 $sig_size = $editor_size;
413
90ffbffc 414 echo "<BR>Signature:<BR><TEXTAREA NAME=signature_edit ROWS=5 COLS=\"$sig_size\">$signature</TEXTAREA><BR>";
f804972b 415 echo "</CENTER>";
416
9d157cec 417 // MESSAGE HIGHLIGHTING
418 echo "<br>\n";
44f642f5 419 echo "<center><b>" . _("Message Highlighting") . "</b> - [<a href=\"msg_highlight.php\">" . _("Edit") . "</a>]</center><br>\n";
9d157cec 420 if (count($message_highlight_list) >= 1) {
44f642f5 421 echo "<table border=0 cellpadding=2 cellspacing=0 align=center width=75%>\n";
9d157cec 422 for ($i=0; $i < count($message_highlight_list); $i++) {
423 echo "<tr>\n";
9d157cec 424 echo " <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
425 echo " " . $message_highlight_list[$i]["name"];
426 echo " </td>\n";
427 echo " <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
3e69e88b 428 echo " ".$message_highlight_list[$i]["match_type"]." = " . $message_highlight_list[$i]["value"];
9d157cec 429 echo " </td>\n";
430 echo "</tr>\n";
431 }
432 echo "</table>\n";
433 } else {
434 echo "<center>" . _("No highlighting is defined") . "</center><br>\n";
435 }
436 echo "<br>\n";
11307a4c 437
438 // SUBMIT BUTTON
a6668eb2 439 echo "<BR><CENTER><INPUT TYPE=SUBMIT VALUE=\"";
440 echo _("Submit");
441 echo "\"></CENTER>\n";
99259b46 442 echo "</FORM>";
65b14f90 443
444 echo "</BODY></HTML>";
a6668eb2 445?>