** Loads preferences from the $username.pref file used by almost
** every other script in the source directory and alswhere.
**
+ ** $Id$
**/
if (!isset($config_php))
include("../functions/plugin.php");
$load_prefs_php = true;
+ if (!isset($username))
+ $username = '';
checkForPrefs($data_dir, $username);
$chosen_theme = getPref($data_dir, $username, "chosen_theme");
- if ((substr($chosen_theme, 0, 10) == "../config/")) {
- $chosen_theme = substr($chosen_theme, 10);
- $chosen_theme = "../themes/$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)) && (file_exists($chosen_theme))) {
}
}
- session_register("theme_css");
+ if (!isset($download_php)) session_register("theme_css");
$use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book");
if ($use_javascript_addr_book == "")
$left_refresh = getPref($data_dir, $username, "left_refresh");
if ($left_refresh == "")
$left_refresh = false;
+
+ $sort = getPref($data_dir, $username, "sort");
+ if ($sort == "")
+ $sort = 6;
/** Load up the Signature file **/
if ($use_signature == true) {
$index_order[$i] = $order;
$order = getPref($data_dir, $username, "order".($i+1));
}
- if (!$index_order) {
+ if (!isset($index_order)) {
$index_order[1] = 1;
$index_order[2] = 2;
$index_order[3] = 3;
$location_of_bar = getPref($data_dir, $username, 'location_of_bar');
if ($location_of_bar == '')
$location_of_bar = 'left';
+
+ $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons');
+ if ($location_of_buttons == '')
+ $location_of_buttons = 'between';
+
+ $collapse_folders = getPref($data_dir, $username, 'collapse_folders');
do_hook("loading_prefs");