db4a47258e1efa902d6c06c7cf22336928ec166f
[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 width="95%" align="center" cellpadding="2" cellspacing="2" border="0">
32 <tr><td bgcolor="<?php echo $color[0] ?>">
33 <center><b><?php echo _("Options") ?></b></center>
34 </td></tr></table>
35
36 <?php
37 if (isset($submit_personal)) {
38 # Save personal information
39 if (isset($full_name)) setPref($data_dir, $username, 'full_name', $full_name);
40 if (isset($email_address)) setPref($data_dir, $username, 'email_address', $email_address);
41 if (isset($reply_to)) setPref($data_dir, $username, 'reply_to', $reply_to);
42 if (! isset($usesignature))
43 $usesignature = 0;
44 setPref($data_dir, $username, 'use_signature', $usesignature);
45 if (! isset($prefixsig))
46 $prefixsig = 0;
47 setPref($data_dir, $username, 'prefix_sig', $prefixsig);
48 if (isset($signature_edit)) setSig($data_dir, $username, $signature_edit);
49
50 do_hook('options_personal_save');
51
52 echo '<br><center><b>'._("Successfully saved personal information!").'</b></center><br>';
53 } else if (isset($submit_display)) {
54 // Do checking to make sure $chosentheme is in the array
55 $in_ary = false;
56 for ($i=0; $i < count($theme); $i++)
57 {
58 if ($theme[$i]['PATH'] == $chosentheme)
59 {
60 $in_ary = true;
61 break;
62 }
63 }
64 if (! $in_ary)
65 $chosentheme = '';
66
67 # Save display preferences
68 setPref($data_dir, $username, 'chosen_theme', $chosentheme);
69 setPref($data_dir, $username, 'show_num', $shownum);
70 setPref($data_dir, $username, 'wrap_at', $wrapat);
71 setPref($data_dir, $username, 'editor_size', $editorsize);
72 setPref($data_dir, $username, 'left_refresh', $leftrefresh);
73 setPref($data_dir, $username, 'language', $language);
74 setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
75 setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
76 setPref($data_dir, $username, 'left_size', $leftsize);
77 setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook);
78 if (isset($altIndexColors) && $altIndexColors == 1)
79 setPref($data_dir, $username, 'alt_index_colors', 1);
80 else
81 setPref($data_dir, $username, 'alt_index_colors', 0);
82 if (isset($showhtmldefault))
83 setPref($data_dir, $username, 'show_html_default', 1);
84 else
85 removePref($data_dir, $username, 'show_html_default');
86
87 do_hook('options_display_save');
88
89 echo '<br><center><b>'._("Successfully saved display preferences!").'</b><br>';
90 echo '<a href="../src/webmail.php?right_frame=options.php" target=_top>' . _("Refresh Page") . '</a></center><br>';
91 } else if (isset($submit_folder)) {
92 # Save folder preferences
93 if ($trash != 'none') {
94 setPref($data_dir, $username, 'move_to_trash', true);
95 setPref($data_dir, $username, 'trash_folder', $trash);
96 } else {
97 setPref($data_dir, $username, 'move_to_trash', '0');
98 setPref($data_dir, $username, 'trash_folder', 'none');
99 }
100 if ($sent != 'none') {
101 setPref($data_dir, $username, 'move_to_sent', true);
102 setPref($data_dir, $username, 'sent_folder', $sent);
103 } else {
104 setPref($data_dir, $username, 'move_to_sent', '0');
105 setPref($data_dir, $username, 'sent_folder', 'none');
106 }
107 setPref($data_dir, $username, 'folder_prefix', $folderprefix);
108 setPref($data_dir, $username, 'unseen_notify', $unseennotify);
109 setPref($data_dir, $username, 'unseen_type', $unseentype);
110 if (isset($collapsefolders))
111 setPref($data_dir, $username, 'collapse_folders', $collapsefolders);
112 else
113 removePref($data_dir, $username, 'collapse_folders');
114 do_hook('options_folders_save');
115 echo '<br><center><b>'._("Successfully saved folder preferences!").'</b><br>';
116 echo '<a href="../src/left_main.php" target=left>' . _("Refresh Folder List") . '</a></center><br>';
117 } else {
118 do_hook('options_save');
119 }
120
121 ?>
122
123
124 <table width="90%" cellpadding="0" cellspacing="10" border="0" align="center">
125 <tr>
126 <td width="50%" valign="top">
127 <table width="100%" cellpadding="3" cellspacing="0" border="0">
128 <tr>
129 <td bgcolor="<?php echo $color[9] ?>">
130 <a href="options_personal.php"><?php echo _("Personal Information"); ?></a>
131 </td>
132 </tr>
133 <tr>
134 <td bgcolor="<?php echo $color[0] ?>">
135 <?php echo _("This contains personal information about yourself such as your name, your email address, etc.") ?>
136 </td>
137 </tr>
138 </table><br>
139 <table width="100%" cellpadding="3" cellspacing="0" border="0">
140 <tr>
141 <td bgcolor="<?php echo $color[9] ?>">
142 <a href="options_highlight.php"><?php echo _("Message Highlighting"); ?></a>
143 </td>
144 </tr>
145 <tr>
146 <td bgcolor="<?php echo $color[0] ?>">
147 <?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.") ?>
148 </td>
149 </tr>
150 </table><br>
151 <table width="100%" cellpadding="3" cellspacing="0" border="0">
152 <tr>
153 <td bgcolor="<?php echo $color[9] ?>">
154 <a href="options_order.php"><?php echo _("Index Order"); ?></a>
155 </td>
156 </tr>
157 <tr>
158 <td bgcolor="<?php echo $color[0] ?>">
159 <?php echo _("The order of the message index can be rearanged and changed to contain the headers in any order you want.") ?>
160 </td>
161 </tr>
162 </table><br>
163 </td>
164 <td valign="top" width="50%">
165 <table width="100%" cellpadding="3" cellspacing="0" border="0">
166 <tr>
167 <td bgcolor="<?php echo $color[9] ?>">
168 <a href="options_display.php"><?php echo _("Display Preferences"); ?></a>
169 </td>
170 </tr>
171 <tr>
172 <td bgcolor="<?php echo $color[0] ?>">
173 <?php echo _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings.") ?>
174 </td>
175 </tr>
176 </table><br>
177 <table width="100%" cellpadding="3" cellspacing="0" border="0">
178 <tr>
179 <td bgcolor="<?php echo $color[9] ?>">
180 <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a>
181 </td>
182 </tr>
183 <tr>
184 <td bgcolor="<?php echo $color[0] ?>">
185 <?php echo _("These settings change the way your folders are displayed and manipulated.") ?>
186 </td>
187 </tr>
188 </table><br>
189 </td>
190 </tr>
191 </table>
192 <?php
193 do_hook('options_link_and_description')
194 ?>
195 </body></html>