- /** load up some of the values from the pref file **/
- $fullname = getPref($data_dir, $username, "full_name");
- $replyto = getPref($data_dir, $username, "reply_to");
- $email_address = getPref($data_dir, $username, "email_address");
-
- echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
- echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo _("Options");
- echo "</FONT>\n";
- echo " </TD></TR>\n";
- echo "</TABLE>\n";
-
- echo "<FORM action=\"options_submit.php\" METHOD=POST>\n";
- echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
- // FULL NAME
- echo " <TR>";
- echo " <TD WIDTH=20% ALIGN=RIGHT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo _("Full Name:");
- echo " </FONT>";
- echo " </TD>";
- echo " <TD WIDTH=80% ALIGN=LEFT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo " <INPUT TYPE=TEXT NAME=full_name VALUE=\"$fullname\" SIZE=50><BR>";
- echo " </FONT>";
- echo " </TD>";
- echo " </TR>";
- // FROM-ADDRESS
- echo " <TR>";
- echo " <TD WIDTH=20% ALIGN=RIGHT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo _("E-mail address:");
- echo " </FONT>";
- echo " </TD>";
- echo " <TD WIDTH=80% ALIGN=LEFT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo " <INPUT TYPE=TEXT NAME=email_address VALUE=\"$email_address\" SIZE=50><BR>";
- echo " </FONT>";
- echo " </TD>";
- echo " </TR>";
- // REPLY-TO
- echo " <TR>";
- echo " <TD WIDTH=20% ALIGN=RIGHT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo _("Reply-to:");
- echo " </FONT>";
- echo " </TD>";
- echo " <TD WIDTH=80% ALIGN=LEFT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo " <INPUT TYPE=TEXT NAME=reply_to VALUE=\"$replyto\" SIZE=50><BR>";
- echo " </FONT>";
- echo " </TD>";
- echo " </TR>";
- // THEME
- echo " <TR>";
- echo " <TD WIDTH=20% ALIGN=RIGHT>";
- echo " <FONT FACE=\"Arial,Helvetica\">";
- echo _("Theme:");
- echo " </FONT>";
- echo " </TD>";
- echo " <TD WIDTH=80% ALIGN=LEFT>";
-
- echo " <TT><SELECT NAME=chosentheme>\n";
- for ($i = 0; $i < count($theme); $i++) {
- if ($theme[$i]["PATH"] == $chosen_theme)
- echo " <OPTION SELECTED VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
- else
- echo " <OPTION VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
+<br>
+<table width=95% align=center cellpadding=2 cellspacing=2 border=0>
+<tr><td bgcolor="<?php echo $color[0] ?>">
+ <center><b><?php echo _("Options") ?></b></center>
+</td></tr></table>
+
+<?php
+ if ($submit_personal) {
+ # Save personal information
+ if (isset($full_name)) setPref($data_dir, $username, "full_name", sqStripSlashes($full_name));
+ if (isset($email_address)) setPref($data_dir, $username, "email_address", sqStripSlashes($email_address));
+ if (isset($reply_to)) setPref($data_dir, $username, "reply_to", sqStripSlashes($reply_to));
+ setPref($data_dir, $username, "use_signature", sqStripSlashes($usesignature));
+ if (isset($signature_edit)) setSig($data_dir, $username, sqStripSlashes($signature_edit));
+
+ do_hook("options_personal_save");
+
+ echo "<br><center><b>"._("Successfully saved personal information!")."</b></center><br>";
+ } else if ($submit_display) {
+ # Save display preferences
+ setPref($data_dir, $username, "chosen_theme", $chosentheme);
+ setPref($data_dir, $username, "show_num", $shownum);
+ setPref($data_dir, $username, "wrap_at", $wrapat);
+ setPref($data_dir, $username, "editor_size", $editorsize);
+ setPref($data_dir, $username, "left_refresh", $leftrefresh);
+ setPref($data_dir, $username, "language", $language);
+ setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
+ setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
+ setPref($data_dir, $username, "left_size", $leftsize);
+ setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
+
+ do_hook("options_display_save");
+
+ echo "<br><center><b>"._("Successfully saved display preferences!")."</b><br>";
+ echo "<a href=\"../src/webmail.php\" target=_top>" . _("Refresh Page") . "</a></center><br>";
+ } else if ($submit_folder) {
+ # Save folder preferences
+ if ($trash != "none") {
+ setPref($data_dir, $username, "move_to_trash", true);
+ setPref($data_dir, $username, "trash_folder", $trash);
+ } else {
+ setPref($data_dir, $username, "move_to_trash", "0");
+ setPref($data_dir, $username, "trash_folder", "none");
+ }
+ if ($sent != "none") {
+ setPref($data_dir, $username, "move_to_sent", true);
+ setPref($data_dir, $username, "sent_folder", $sent);
+ } else {
+ setPref($data_dir, $username, "move_to_sent", "0");
+ setPref($data_dir, $username, "sent_folder", "none");
+ }
+ setPref($data_dir, $username, "folder_prefix", $folderprefix);
+ setPref($data_dir, $username, "unseen_notify", $unseennotify);
+ setPref($data_dir, $username, "unseen_type", $unseentype);
+ do_hook("options_folders_save");
+ echo "<br><center><b>"._("Successfully saved folder preferences!")."</b><br>";
+ echo "<a href=\"../src/left_main.php\" target=left>" . _("Refresh Folder List") . "</a></center><br>";
+ } else {
+ do_hook("options_save");