* <div> tags were unneeded. Centering was already done in the table.
[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 **
245a6892 11 ** $Id$
ef870322 12 **/
13
f740c049 14 include('../src/validate.php');
f740c049 15 include('../functions/page_header.php');
16 include('../functions/display_messages.php');
17 include('../functions/imap.php');
18 include('../functions/array.php');
d3cdb279 19
7aaa81fc 20 if (isset($language)) {
db5910ac 21 setcookie('squirrelmail_language', $language, time()+2592000);
c36ed9cf 22 $squirrelmail_language = $language;
37df47f5 23 }
1e0628fb 24
db5910ac 25 include('../src/load_prefs.php');
e7db48af 26 displayPageHeader($color, _("None"));
f740c049 27
c36ed9cf 28?>
11307a4c 29
e9f8ea4e 30<br>
e7db48af 31<table bgcolor="<?php echo $color[0] ?>" width="95%" align="center" cellpadding="2" cellspacing="0" border="0">
32<tr><td align="center">
33
34 <b><?php echo _("Options") ?></b><br>
35
36 <table width="100%" border="0" cellpadding="5" cellspacing="0">
37 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
c36ed9cf 38
6170c5b6 39<?php
245a6892 40 if (isset($submit_personal)) {
c36ed9cf 41 # Save personal information
aaf9abef 42 if (isset($full_name))
43 setPref($data_dir, $username, 'full_name', $full_name);
44 if (isset($email_address))
45 setPref($data_dir, $username, 'email_address', $email_address);
46 if (isset($reply_to))
47 setPref($data_dir, $username, 'reply_to', $reply_to);
aab2c92c 48 if (! isset($usesignature))
49 $usesignature = 0;
f740c049 50 setPref($data_dir, $username, 'use_signature', $usesignature);
51 if (! isset($prefixsig))
52 $prefixsig = 0;
53 setPref($data_dir, $username, 'prefix_sig', $prefixsig);
d51894be 54 if (isset($signature_edit)) setSig($data_dir, $username, $signature_edit);
2848c630 55
db5910ac 56 do_hook('options_personal_save');
ef3c69f0 57
e7db48af 58 echo '<br><b>'._("Successfully saved personal information!").'</b><br>';
f740c049 59 } else if (isset($submit_display)) {
60 // Do checking to make sure $chosentheme is in the array
61 $in_ary = false;
62 for ($i=0; $i < count($theme); $i++)
63 {
64 if ($theme[$i]['PATH'] == $chosentheme)
65 {
66 $in_ary = true;
67 break;
68 }
69 }
70 if (! $in_ary)
71 $chosentheme = '';
72
c36ed9cf 73 # Save display preferences
db5910ac 74 setPref($data_dir, $username, 'chosen_theme', $chosentheme);
75 setPref($data_dir, $username, 'show_num', $shownum);
76 setPref($data_dir, $username, 'wrap_at', $wrapat);
77 setPref($data_dir, $username, 'editor_size', $editorsize);
78 setPref($data_dir, $username, 'left_refresh', $leftrefresh);
79 setPref($data_dir, $username, 'language', $language);
9a732bb6 80 setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
441f2d33 81 setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
db5910ac 82 setPref($data_dir, $username, 'left_size', $leftsize);
83 setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook);
ac53fb56 84 if (isset($altIndexColors) && $altIndexColors == 1)
85 setPref($data_dir, $username, 'alt_index_colors', 1);
86 else
87 setPref($data_dir, $username, 'alt_index_colors', 0);
e2ab93e5 88 if (isset($showhtmldefault))
89 setPref($data_dir, $username, 'show_html_default', 1);
90 else
91 removePref($data_dir, $username, 'show_html_default');
c36ed9cf 92
db5910ac 93 do_hook('options_display_save');
ef3c69f0 94
e7db48af 95 echo '<br><b>'._("Successfully saved display preferences!").'</b><br>';
96 echo '<a href="../src/webmail.php?right_frame=options.php" target=_top>' . _("Refresh Page") . '</a><br>';
245a6892 97 } else if (isset($submit_folder)) {
c36ed9cf 98 # Save folder preferences
db5910ac 99 if ($trash != 'none') {
100 setPref($data_dir, $username, 'move_to_trash', true);
101 setPref($data_dir, $username, 'trash_folder', $trash);
c36ed9cf 102 } else {
db5910ac 103 setPref($data_dir, $username, 'move_to_trash', '0');
104 setPref($data_dir, $username, 'trash_folder', 'none');
9d157cec 105 }
db5910ac 106 if ($sent != 'none') {
107 setPref($data_dir, $username, 'move_to_sent', true);
108 setPref($data_dir, $username, 'sent_folder', $sent);
c36ed9cf 109 } else {
db5910ac 110 setPref($data_dir, $username, 'move_to_sent', '0');
111 setPref($data_dir, $username, 'sent_folder', 'none');
c36ed9cf 112 }
f740c049 113 setPref($data_dir, $username, 'folder_prefix', $folderprefix);
db5910ac 114 setPref($data_dir, $username, 'unseen_notify', $unseennotify);
115 setPref($data_dir, $username, 'unseen_type', $unseentype);
235a65d5 116 if (isset($collapsefolders))
117 setPref($data_dir, $username, 'collapse_folders', $collapsefolders);
118 else
119 removePref($data_dir, $username, 'collapse_folders');
db5910ac 120 do_hook('options_folders_save');
e7db48af 121 echo '<br><b>'._("Successfully saved folder preferences!").'</b><br>';
122 echo '<a href="../src/left_main.php" target=left>' . _("Refresh Folder List") . '</a><br>';
6b638171 123 } else {
db5910ac 124 do_hook('options_save');
9d157cec 125 }
6b638171 126
c36ed9cf 127?>
11307a4c 128
e7db48af 129<table bgcolor="<?php echo $color[4] ?>" width="100%" cellpadding="5" cellspacing="0" border="0">
c36ed9cf 130<tr>
db5910ac 131 <td width="50%" valign="top">
132 <table width="100%" cellpadding="3" cellspacing="0" border="0">
c36ed9cf 133 <tr>
6170c5b6 134 <td bgcolor="<?php echo $color[9] ?>">
135 <a href="options_personal.php"><?php echo _("Personal Information"); ?></a>
c36ed9cf 136 </td>
137 </tr>
138 <tr>
6170c5b6 139 <td bgcolor="<?php echo $color[0] ?>">
140 <?php echo _("This contains personal information about yourself such as your name, your email address, etc.") ?>
c36ed9cf 141 </td>
142 </tr>
143 </table><br>
db5910ac 144 <table width="100%" cellpadding="3" cellspacing="0" border="0">
c36ed9cf 145 <tr>
6170c5b6 146 <td bgcolor="<?php echo $color[9] ?>">
147 <a href="options_highlight.php"><?php echo _("Message Highlighting"); ?></a>
c36ed9cf 148 </td>
149 </tr>
150 <tr>
6170c5b6 151 <td bgcolor="<?php echo $color[0] ?>">
152 <?php echo _("Based upon given criteria, incoming messages can have different background colors in the message list. This helps to easily distinguish who the messages are from, especially for mailing lists.") ?>
c36ed9cf 153 </td>
154 </tr>
155 </table><br>
db5910ac 156 <table width="100%" cellpadding="3" cellspacing="0" border="0">
8e265988 157 <tr>
158 <td bgcolor="<?php echo $color[9] ?>">
159 <a href="options_order.php"><?php echo _("Index Order"); ?></a>
160 </td>
161 </tr>
162 <tr>
163 <td bgcolor="<?php echo $color[0] ?>">
164 <?php echo _("The order of the message index can be rearanged and changed to contain the headers in any order you want.") ?>
165 </td>
166 </tr>
167 </table><br>
c36ed9cf 168 </td>
db5910ac 169 <td valign="top" width="50%">
170 <table width="100%" cellpadding="3" cellspacing="0" border="0">
c36ed9cf 171 <tr>
6170c5b6 172 <td bgcolor="<?php echo $color[9] ?>">
173 <a href="options_display.php"><?php echo _("Display Preferences"); ?></a>
c36ed9cf 174 </td>
175 </tr>
176 <tr>
6170c5b6 177 <td bgcolor="<?php echo $color[0] ?>">
178 <?php echo _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings.") ?>
c36ed9cf 179 </td>
180 </tr>
181 </table><br>
db5910ac 182 <table width="100%" cellpadding="3" cellspacing="0" border="0">
c36ed9cf 183 <tr>
6170c5b6 184 <td bgcolor="<?php echo $color[9] ?>">
185 <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a>
c36ed9cf 186 </td>
187 </tr>
188 <tr>
6170c5b6 189 <td bgcolor="<?php echo $color[0] ?>">
190 <?php echo _("These settings change the way your folders are displayed and manipulated.") ?>
c36ed9cf 191 </td>
192 </tr>
193 </table><br>
194 </td>
195</tr>
196</table>
e7db48af 197
198 <?php do_hook('options_link_and_description'); ?>
199
200
201 </td></tr>
202 </table>
203
204</td></tr>
205</table>
206
c36ed9cf 207</body></html>