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