* <div> tags were unneeded. Centering was already done in the table.
[squirrelmail.git] / src / options.php
1 <?php
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 ** $Id$
12 **/
13
14 include('../src/validate.php');
15 include('../functions/page_header.php');
16 include('../functions/display_messages.php');
17 include('../functions/imap.php');
18 include('../functions/array.php');
19
20 if (isset($language)) {
21 setcookie('squirrelmail_language', $language, time()+2592000);
22 $squirrelmail_language = $language;
23 }
24
25 include('../src/load_prefs.php');
26 displayPageHeader($color, _("None"));
27
28 ?>
29
30 <br>
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">
38
39 <?php
40 if (isset($submit_personal)) {
41 # Save personal information
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);
48 if (! isset($usesignature))
49 $usesignature = 0;
50 setPref($data_dir, $username, 'use_signature', $usesignature);
51 if (! isset($prefixsig))
52 $prefixsig = 0;
53 setPref($data_dir, $username, 'prefix_sig', $prefixsig);
54 if (isset($signature_edit)) setSig($data_dir, $username, $signature_edit);
55
56 do_hook('options_personal_save');
57
58 echo '<br><b>'._("Successfully saved personal information!").'</b><br>';
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
73 # Save display preferences
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);
80 setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
81 setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
82 setPref($data_dir, $username, 'left_size', $leftsize);
83 setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook);
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);
88 if (isset($showhtmldefault))
89 setPref($data_dir, $username, 'show_html_default', 1);
90 else
91 removePref($data_dir, $username, 'show_html_default');
92
93 do_hook('options_display_save');
94
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>';
97 } else if (isset($submit_folder)) {
98 # Save folder preferences
99 if ($trash != 'none') {
100 setPref($data_dir, $username, 'move_to_trash', true);
101 setPref($data_dir, $username, 'trash_folder', $trash);
102 } else {
103 setPref($data_dir, $username, 'move_to_trash', '0');
104 setPref($data_dir, $username, 'trash_folder', 'none');
105 }
106 if ($sent != 'none') {
107 setPref($data_dir, $username, 'move_to_sent', true);
108 setPref($data_dir, $username, 'sent_folder', $sent);
109 } else {
110 setPref($data_dir, $username, 'move_to_sent', '0');
111 setPref($data_dir, $username, 'sent_folder', 'none');
112 }
113 setPref($data_dir, $username, 'folder_prefix', $folderprefix);
114 setPref($data_dir, $username, 'unseen_notify', $unseennotify);
115 setPref($data_dir, $username, 'unseen_type', $unseentype);
116 if (isset($collapsefolders))
117 setPref($data_dir, $username, 'collapse_folders', $collapsefolders);
118 else
119 removePref($data_dir, $username, 'collapse_folders');
120 do_hook('options_folders_save');
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>';
123 } else {
124 do_hook('options_save');
125 }
126
127 ?>
128
129 <table bgcolor="<?php echo $color[4] ?>" width="100%" cellpadding="5" cellspacing="0" border="0">
130 <tr>
131 <td width="50%" valign="top">
132 <table width="100%" cellpadding="3" cellspacing="0" border="0">
133 <tr>
134 <td bgcolor="<?php echo $color[9] ?>">
135 <a href="options_personal.php"><?php echo _("Personal Information"); ?></a>
136 </td>
137 </tr>
138 <tr>
139 <td bgcolor="<?php echo $color[0] ?>">
140 <?php echo _("This contains personal information about yourself such as your name, your email address, etc.") ?>
141 </td>
142 </tr>
143 </table><br>
144 <table width="100%" cellpadding="3" cellspacing="0" border="0">
145 <tr>
146 <td bgcolor="<?php echo $color[9] ?>">
147 <a href="options_highlight.php"><?php echo _("Message Highlighting"); ?></a>
148 </td>
149 </tr>
150 <tr>
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.") ?>
153 </td>
154 </tr>
155 </table><br>
156 <table width="100%" cellpadding="3" cellspacing="0" border="0">
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>
168 </td>
169 <td valign="top" width="50%">
170 <table width="100%" cellpadding="3" cellspacing="0" border="0">
171 <tr>
172 <td bgcolor="<?php echo $color[9] ?>">
173 <a href="options_display.php"><?php echo _("Display Preferences"); ?></a>
174 </td>
175 </tr>
176 <tr>
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.") ?>
179 </td>
180 </tr>
181 </table><br>
182 <table width="100%" cellpadding="3" cellspacing="0" border="0">
183 <tr>
184 <td bgcolor="<?php echo $color[9] ?>">
185 <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a>
186 </td>
187 </tr>
188 <tr>
189 <td bgcolor="<?php echo $color[0] ?>">
190 <?php echo _("These settings change the way your folders are displayed and manipulated.") ?>
191 </td>
192 </tr>
193 </table><br>
194 </td>
195 </tr>
196 </table>
197
198 <?php do_hook('options_link_and_description'); ?>
199
200
201 </td></tr>
202 </table>
203
204 </td></tr>
205 </table>
206
207 </body></html>