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