Added basic support for message highlighting. Note that this needs quite
[squirrelmail.git] / src / load_prefs.php
1 <?php
2 if (!isset($config_php))
3 include("../config/config.php");
4 if (!isset($prefs_php))
5 include("../functions/prefs.php");
6
7 $load_prefs_php = true;
8 checkForPrefs($data_dir, $username);
9
10 $chosen_theme = getPref($data_dir, $username, "chosen_theme");
11
12 if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
13 require("$chosen_theme");
14 } else {
15 if (file_exists($theme[0]["PATH"])) {
16 require($theme[0]["PATH"]);
17 } else {
18 echo _("Theme: ");
19 echo $theme[0]["PATH"];
20 echo _(" was not found.");
21 echo "<BR>";
22 echo _("Exiting abnormally");
23 exit;
24 }
25 }
26
27 $use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book");
28 if ($use_javascript_addr_book == "")
29 $use_javascript_addr_book = $default_use_javascript_addr_book;
30
31
32 /** Load the user's sent folder preferences **/
33 $move_to_sent = getPref($data_dir, $username, "move_to_sent");
34 if ($move_to_sent == "")
35 $move_to_sent = $default_move_to_sent;
36
37 /** Load the user's trash folder preferences **/
38 $move_to_trash = getPref($data_dir, $username, "move_to_trash");
39 if ($move_to_trash == "")
40 $move_to_trash = $default_move_to_trash;
41
42
43 $folder_prefix = getPref($data_dir, $username, "folder_prefix");
44 if ($folder_prefix == "")
45 $folder_prefix = $default_folder_prefix;
46
47 /** Load special folders **/
48 $new_trash_folder = getPref($data_dir, $username, "trash_folder");
49 if (($new_trash_folder == "") && ($move_to_trash == true))
50 $trash_folder = $folder_prefix . $trash_folder;
51 else
52 $trash_folder = $new_trash_folder;
53
54 /** Load special folders **/
55 $new_sent_folder = getPref($data_dir, $username, "sent_folder");
56 if (($new_sent_folder == "") && ($move_to_sent == true))
57 $sent_folder = $folder_prefix . $sent_folder;
58 else
59 $sent_folder = $new_sent_folder;
60
61 $show_num = getPref($data_dir, $username, "show_num");
62 if ($show_num == "")
63 $show_num = 25;
64
65 $wrap_at = getPref($data_dir, $username, "wrap_at");
66 if ($wrap_at == "")
67 $wrap_at = 86;
68
69 $left_size = getPref($data_dir, $username, "left_size");
70 if ($left_size == "") {
71 if (isset($default_left_size))
72 $left_size = $default_left_size;
73 else
74 $left_size = 200;
75 }
76
77 $editor_size = getPref($data_dir, $username, "editor_size");
78 if ($editor_size == "")
79 $editor_size = 76;
80
81 $use_signature = getPref($data_dir, $username, "use_signature");
82 if ($use_signature == "")
83 $use_signature = false;
84
85 $left_refresh = getPref($data_dir, $username, "left_refresh");
86 if ($left_refresh == "")
87 $left_refresh = false;
88
89 /** Load up the Signature file **/
90 if ($use_signature == true) {
91 $signature = getSig($data_dir, $username);
92 } else {
93 }
94
95 /** Load up the Language preference **/
96 $user_language = getPref($data_dir, $username, "language");
97 if ($user_language == "") {
98 if (isset($default_charset))
99 $user_language = $default_charset;
100 else
101 $user_language = en;
102 }
103
104 // highlightX comes in with the form: name,color,header,value
105 for ($i=0; $hlt = getPref($data_dir, $username, "highlight$i"); $i++) {
106 $ary = explode(",", $hlt);
107 $message_highlight_list[$i]["name"] = $ary[0];
108 $message_highlight_list[$i]["color"] = $ary[1];
109 $message_highlight_list[$i]["value"] = $ary[2];
110 }
111 ?>