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