5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 ** Loads preferences from the $username.pref file used by almost
9 ** every other script in the source directory and alswhere.
14 if (!isset($config_php))
15 include("../config/config.php");
16 if (!isset($prefs_php))
17 include("../functions/prefs.php");
18 if (!isset($plugin_php))
19 include("../functions/plugin.php");
21 $load_prefs_php = true;
22 checkForPrefs($data_dir, $username);
24 $chosen_theme = getPref($data_dir, $username, "chosen_theme");
26 for ($i=0; $i < count($theme); $i++
){
27 if ($theme[$i]["PATH"] == $chosen_theme) {
36 if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
37 require("$chosen_theme");
39 if (file_exists($theme[0]["PATH"])) {
40 require($theme[0]["PATH"]);
43 # I hard coded the theme as a last resort if no themes were
44 # found. It makes no sense to cause the whole thing to exit
45 # just because themes were not found. This is the absolute
48 $color[0] = "#DCDCDC"; // (light gray) TitleBar
49 $color[1] = "#800000"; // (red)
50 $color[2] = "#CC0000"; // (light red) Warning/Error Messages
51 $color[3] = "#A0B8C8"; // (green-blue) Left Bar Background
52 $color[4] = "#FFFFFF"; // (white) Normal Background
53 $color[5] = "#FFFFCC"; // (light yellow) Table Headers
54 $color[6] = "#000000"; // (black) Text on left bar
55 $color[7] = "#0000CC"; // (blue) Links
56 $color[8] = "#000000"; // (black) Normal text
57 $color[9] = "#ABABAB"; // (mid-gray) Darker version of #0
58 $color[10] = "#666666"; // (dark gray) Darker version of #9
59 $color[11] = "#770000"; // (dark red) Special Folders color
63 if (!isset($download_php)) session_register("theme_css");
65 $use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book");
66 if ($use_javascript_addr_book == "")
67 $use_javascript_addr_book = $default_use_javascript_addr_book;
70 /** Load the user's sent folder preferences **/
71 $move_to_sent = getPref($data_dir, $username, "move_to_sent");
72 if ($move_to_sent == "")
73 $move_to_sent = $default_move_to_sent;
75 /** Load the user's trash folder preferences **/
76 $move_to_trash = getPref($data_dir, $username, "move_to_trash");
77 if ($move_to_trash == "")
78 $move_to_trash = $default_move_to_trash;
81 $unseen_type = getPref($data_dir, $username, "unseen_type");
82 if ($default_unseen_type == "")
83 $default_unseen_type = 1;
84 if ($unseen_type == "")
85 $unseen_type = $default_unseen_type;
87 $unseen_notify = getPref($data_dir, $username, "unseen_notify");
88 if ($default_unseen_notify == "")
89 $default_unseen_notify = 2;
90 if ($unseen_notify == "")
91 $unseen_notify = $default_unseen_notify;
94 $folder_prefix = getPref($data_dir, $username, "folder_prefix");
95 if ($folder_prefix == "")
96 $folder_prefix = $default_folder_prefix;
98 /** Load special folders **/
99 $new_trash_folder = getPref($data_dir, $username, "trash_folder");
100 if (($new_trash_folder == "") && ($move_to_trash == true))
101 $trash_folder = $folder_prefix . $trash_folder;
103 $trash_folder = $new_trash_folder;
105 /** Load special folders **/
106 $new_sent_folder = getPref($data_dir, $username, "sent_folder");
107 if (($new_sent_folder == "") && ($move_to_sent == true))
108 $sent_folder = $folder_prefix . $sent_folder;
110 $sent_folder = $new_sent_folder;
112 $show_num = getPref($data_dir, $username, "show_num");
116 $wrap_at = getPref($data_dir, $username, "wrap_at");
122 $left_size = getPref($data_dir, $username, "left_size");
123 if ($left_size == "") {
124 if (isset($default_left_size))
125 $left_size = $default_left_size;
130 $editor_size = getPref($data_dir, $username, "editor_size");
131 if ($editor_size == "")
134 $use_signature = getPref($data_dir, $username, "use_signature");
135 if ($use_signature == "")
136 $use_signature = false;
138 $left_refresh = getPref($data_dir, $username, "left_refresh");
139 if ($left_refresh == "")
140 $left_refresh = false;
142 $sort = getPref($data_dir, $username, "sort");
146 /** Load up the Signature file **/
147 if ($use_signature == true) {
148 $signature_abs = $signature = getSig($data_dir, $username);
150 $signature_abs = getSig($data_dir, $username);
153 // highlightX comes in with the form: name,color,header,value
154 for ($i=0; $hlt = getPref($data_dir, $username, "highlight$i"); $i++
) {
155 $ary = explode(",", $hlt);
156 $message_highlight_list[$i]["name"] = $ary[0];
157 $message_highlight_list[$i]["color"] = $ary[1];
158 $message_highlight_list[$i]["value"] = $ary[2];
159 $message_highlight_list[$i]["match_type"] = $ary[3];
162 #index order lets you change the order of the message index
163 $order = getPref($data_dir, $username, "order1");
164 for ($i=1; $order; $i++
) {
165 $index_order[$i] = $order;
166 $order = getPref($data_dir, $username, "order".($i+
1));
176 $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
177 if ($location_of_bar == '')
178 $location_of_bar = 'left';
180 $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons');
181 if ($location_of_buttons == '')
182 $location_of_buttons = 'between';
184 do_hook("loading_prefs");