- global $theme, $chosen_theme, $color;
- if (! isset($theme)) { $theme = array(); }
- if (! isset($color)) { $color = array(); }
- require_once('../functions/prefs.php');
- require_once('../functions/plugin.php');
- require_once('../functions/constants.php');
-
- if (!isset($username)) { $username = ''; }
-
- $chosen_theme = getPref($data_dir, $username, "chosen_theme");
- $in_ary = false;
- for ($i=0; $i < count($theme); $i++){
- if ($theme[$i]["PATH"] == $chosen_theme) {
- $in_ary = true;
- break;
- }
- }
- if (! $in_ary) { $chosen_theme = ""; }
-
- if (isset($chosen_theme) && $in_ary && (file_exists($chosen_theme))) {
- @include_once($chosen_theme);
- } else {
- if (isset($theme) && isset($theme[0])
- && file_exists($theme[0]["PATH"])) {
- @include_once($theme[0]["PATH"]);
- } else {
- /**
- * This theme as a failsafe if no themes were found. It makes
- * no sense to cause the whole thing to exit just because themes
- * were not found. This is the absolute last resort.
- */
- $color[0] = "#DCDCDC"; // light gray TitleBar
- $color[1] = "#800000"; // red
- $color[2] = "#CC0000"; // light red Warning/Error Messages
- $color[3] = "#A0B8C8"; // green-blue Left Bar Background
- $color[4] = "#FFFFFF"; // white Normal Background
- $color[5] = "#FFFFCC"; // light yellow Table Headers
- $color[6] = "#000000"; // black Text on left bar
- $color[7] = "#0000CC"; // blue Links
- $color[8] = "#000000"; // black Normal text
- $color[9] = "#ABABAB"; // mid-gray Darker version of #0
- $color[10] = "#666666"; // dark gray Darker version of #9
- $color[11] = "#770000"; // dark red Special Folders color
- }
- }
-
- if (!defined('download_php')) { session_register("theme_css"); }
-
- global $use_javascript_addr_book;
- $use_javascript_addr_book = getPref($data_dir, $username, 'use_javascript_addr_book', $default_use_javascript_addr_book);
-
- /** Declare the global variables for the special folders. */
- global $move_to_sent, $move_to_trash, $save_as_draft;
-
- /** Load the user's special folder preferences **/
- $move_to_sent = getPref($data_dir, $username, 'move_to_sent', $default_move_to_sent);
- $move_to_trash = getPref($data_dir, $username, 'move_to_trash', $default_move_to_trash);
- $save_as_draft = getPref($data_dir, $username, 'save_as_draft', $default_save_as_draft);
-
- global $unseen_type, $unseen_notify;
- if ($default_unseen_type == '') { $default_unseen_type = 1; }
- $unseen_type = getPref($data_dir, $username, 'unseen_type', $default_unseen_type);
- if ($default_unseen_notify == '') { $default_unseen_notify = 2; }
- $unseen_notify = getPref($data_dir, $username, 'unseen_notify', $default_unseen_notify);