* Header rearranged
[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 require_once('../src/validate.php');
15 require_once('../functions/display_messages.php');
16 require_once('../functions/imap.php');
17 require_once('../functions/array.php');
18
19 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
20 $base_uri = $regs[1];
21
22 if (isset($language)) {
23 setcookie('squirrelmail_language', $language, time()+2592000, $base_uri);
24 $squirrelmail_language = $language;
25 }
26
27 displayPageHeader($color, _("None"));
28
29 ?>
30
31 <br>
32 <table bgcolor="<?php echo $color[0] ?>" width="95%" align="center" cellpadding="2" cellspacing="0" border="0">
33 <tr><td align="center">
34
35 <b><?php echo _("Options") ?></b><br>
36
37 <table width="100%" border="0" cellpadding="5" cellspacing="0">
38 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
39
40 <?php
41 if (isset($submit_personal)) {
42 # Save personal information
43 if (isset($full_name)) {
44 setPref($data_dir, $username, 'full_name', $full_name);
45 }
46 if (isset($email_address)) {
47 setPref($data_dir, $username, 'email_address', $email_address);
48 }
49 if (isset($reply_to)) {
50 setPref($data_dir, $username, 'reply_to', $reply_to);
51 }
52 setPref($data_dir, $username, 'reply_citation_style', $new_reply_citation_style);
53 setPref($data_dir, $username, 'reply_citation_start', $new_reply_citation_start);
54 setPref($data_dir, $username, 'reply_citation_end', $new_reply_citation_end);
55 if (! isset($usesignature))
56 $usesignature = 0;
57 setPref($data_dir, $username, 'use_signature', $usesignature);
58 if (! isset($prefixsig)) {
59 $prefixsig = 0;
60 }
61 setPref($data_dir, $username, 'prefix_sig', $prefixsig);
62 if (isset($signature_edit)) {
63 setSig($data_dir, $username, $signature_edit);
64 }
65
66 do_hook('options_personal_save');
67
68 echo '<br><b>'._("Successfully saved personal information!").'</b><br>';
69 } else if (isset($submit_display)) {
70 // Do checking to make sure $chosentheme is in the array
71 $in_ary = false;
72 for ($i=0; $i < count($theme); $i++)
73 {
74 if ($theme[$i]['PATH'] == $chosentheme)
75 {
76 $in_ary = true;
77 break;
78 }
79 }
80 if (! $in_ary)
81 $chosentheme = '';
82
83 # Save display preferences
84 setPref($data_dir, $username, 'chosen_theme', $chosentheme);
85 setPref($data_dir, $username, 'language', $language);
86 setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook);
87 setPref($data_dir, $username, 'show_num', $shownum);
88 setPref($data_dir, $username, 'wrap_at', $wrapat);
89 setPref($data_dir, $username, 'editor_size', $editorsize);
90 setPref($data_dir, $username, 'left_refresh', $leftrefresh);
91 setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
92 setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
93 setPref($data_dir, $username, 'left_size', $leftsize);
94
95 if (isset($altIndexColors) && $altIndexColors == 1) {
96 setPref($data_dir, $username, 'alt_index_colors', 1);
97 } else {
98 setPref($data_dir, $username, 'alt_index_colors', 0);
99 }
100
101 if (isset($showhtmldefault)) {
102 setPref($data_dir, $username, 'show_html_default', 1);
103 } else {
104 removePref($data_dir, $username, 'show_html_default');
105 }
106
107 if (isset($includeselfreplyall)) {
108 setPref($data_dir, $username, 'include_self_reply_all', 1);
109 } else {
110 removePref($data_dir, $username, 'include_self_reply_all');
111 }
112
113 if (isset($pageselectormax)) {
114 setPref($data_dir, $username, 'page_selector_max', $pageselectormax);
115 } else {
116 removePref($data_dir, $username, 'page_selector_max', 0 );
117 }
118
119 if (isset($pageselector)) {
120 removePref($data_dir, $username, 'page_selector');
121 } else {
122 setPref($data_dir, $username, 'page_selector', 1);
123 }
124
125 do_hook('options_display_save');
126
127 echo '<br><b>'._("Successfully saved display preferences!").'</b><br>';
128 echo '<a href="../src/webmail.php?right_frame=options.php" target=_top>' . _("Refresh Page") . '</a><br>';
129 } else if (isset($submit_folder)) {
130 # Save folder preferences
131 if ($trash != 'none') {
132 setPref($data_dir, $username, 'move_to_trash', true);
133 setPref($data_dir, $username, 'trash_folder', $trash);
134 } else {
135 setPref($data_dir, $username, 'move_to_trash', '0');
136 setPref($data_dir, $username, 'trash_folder', 'none');
137 }
138 if ($sent != 'none') {
139 setPref($data_dir, $username, 'move_to_sent', true);
140 setPref($data_dir, $username, 'sent_folder', $sent);
141 } else {
142 setPref($data_dir, $username, 'move_to_sent', '0');
143 setPref($data_dir, $username, 'sent_folder', 'none');
144 }
145 if (isset($folderprefix)) {
146 setPref($data_dir, $username, 'folder_prefix', $folderprefix);
147 } else {
148 setPref($data_dir, $username, 'folder_prefix', '');
149 }
150 setPref($data_dir, $username, 'unseen_notify', $unseennotify);
151 setPref($data_dir, $username, 'unseen_type', $unseentype);
152 if (isset($collapsefolders))
153 setPref($data_dir, $username, 'collapse_folders', $collapsefolders);
154 else
155 removePref($data_dir, $username, 'collapse_folders');
156 do_hook('options_folders_save');
157 echo '<br><b>'._("Successfully saved folder preferences!").'</b><br>';
158 echo '<a href="../src/left_main.php" target=left>' . _("Refresh Folder List") . '</a><br>';
159 } else {
160 do_hook('options_save');
161 }
162
163 ?>
164
165 <table bgcolor="<?php echo $color[4] ?>" width="100%" cellpadding="5" cellspacing="0" border="0">
166 <tr>
167 <td width="50%" valign="top">
168 <table width="100%" cellpadding="3" cellspacing="0" border="0">
169 <tr>
170 <td bgcolor="<?php echo $color[9] ?>">
171 <a href="options_personal.php"><?php echo _("Personal Information"); ?></a>
172 </td>
173 </tr>
174 <tr>
175 <td bgcolor="<?php echo $color[0] ?>">
176 <?php echo _("This contains personal information about yourself such as your name, your email address, etc.") ?>
177 </td>
178 </tr>
179 </table><br>
180 <table width="100%" cellpadding="3" cellspacing="0" border="0">
181 <tr>
182 <td bgcolor="<?php echo $color[9] ?>">
183 <a href="options_highlight.php"><?php echo _("Message Highlighting"); ?></a>
184 </td>
185 </tr>
186 <tr>
187 <td bgcolor="<?php echo $color[0] ?>">
188 <?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.") ?>
189 </td>
190 </tr>
191 </table><br>
192 <table width="100%" cellpadding="3" cellspacing="0" border="0">
193 <tr>
194 <td bgcolor="<?php echo $color[9] ?>">
195 <a href="options_order.php"><?php echo _("Index Order"); ?></a>
196 </td>
197 </tr>
198 <tr>
199 <td bgcolor="<?php echo $color[0] ?>">
200 <?php echo _("The order of the message index can be rearanged and changed to contain the headers in any order you want.") ?>
201 </td>
202 </tr>
203 </table><br>
204 </td>
205 <td valign="top" width="50%">
206 <table width="100%" cellpadding="3" cellspacing="0" border="0">
207 <tr>
208 <td bgcolor="<?php echo $color[9] ?>">
209 <a href="options_display.php"><?php echo _("Display Preferences"); ?></a>
210 </td>
211 </tr>
212 <tr>
213 <td bgcolor="<?php echo $color[0] ?>">
214 <?php echo _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings.") ?>
215 </td>
216 </tr>
217 </table><br>
218 <table width="100%" cellpadding="3" cellspacing="0" border="0">
219 <tr>
220 <td bgcolor="<?php echo $color[9] ?>">
221 <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a>
222 </td>
223 </tr>
224 <tr>
225 <td bgcolor="<?php echo $color[0] ?>">
226 <?php echo _("These settings change the way your folders are displayed and manipulated.") ?>
227 </td>
228 </tr>
229 </table><br>
230 </td>
231 </tr>
232 </table>
233
234 <?php do_hook('options_link_and_description'); ?>
235
236
237 </td></tr>
238 </table>
239
240 </td></tr>
241 </table>
242
243 </body></html>