From: Janusz Dobrowolski Date: Sun, 22 Feb 2009 20:19:20 +0000 (+0000) Subject: Default theme and language for not logged user. X-Git-Tag: v2.4.2~19^2~1512 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=0d6c125d288d9b8c533b179f7f88aa748890047a;p=fa-stable.git Default theme and language for not logged user. --- diff --git a/includes/current_user.inc b/includes/current_user.inc index d180d0fb..dabec3ce 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -30,10 +30,10 @@ class current_user function current_user() { - $this->loginname = $username = $this->name = $this->company = ""; + $this->loginname = $this->username = $this->name = $this->company = ""; $this->logged = false; - $this->prefs = null; + $this->prefs = new user_prefs(); } function logged_in() diff --git a/includes/prefs/userprefs.inc b/includes/prefs/userprefs.inc index 00b77a9a..43afba6f 100644 --- a/includes/prefs/userprefs.inc +++ b/includes/prefs/userprefs.inc @@ -34,30 +34,38 @@ class user_prefs var $query_size; // table pager page length var $graphic_links; // use graphic links - function user_prefs(&$user) - { - - $this->language = $user["language"]; - language::set_language($this->language); - - $this->qty_dec = $user["qty_dec"]; - $this->price_dec = $user["prices_dec"]; - $this->exrate_dec = $user["rates_dec"]; - $this->percent_dec = $user["percent_dec"]; - - $this->show_gl_info = $user["show_gl"]; - $this->show_codes = $user["show_codes"]; - $this->date_format = $user["date_format"]; - $this->date_sep = $user["date_sep"]; - $this->tho_sep = $user["tho_sep"]; - $this->dec_sep = $user["dec_sep"]; - $this->theme = $user["theme"]; - $this->pagesize = $user["page_size"]; - $this->show_hints = $user["show_hints"]; - $this->print_profile = $user["print_profile"]; - $this->rep_popup = $user["rep_popup"]; - $this->query_size = $user["query_size"]; - $this->graphic_links = $user["graphic_links"]; + function user_prefs($user=null) + { + if ($user == null) { + // set default values, used before login + global $dflt_lang; + + $this->language = $dflt_lang; + $this->theme = 'default'; + + } else { + $this->language = $user["language"]; + language::set_language($this->language); + + $this->qty_dec = $user["qty_dec"]; + $this->price_dec = $user["prices_dec"]; + $this->exrate_dec = $user["rates_dec"]; + $this->percent_dec = $user["percent_dec"]; + + $this->show_gl_info = $user["show_gl"]; + $this->show_codes = $user["show_codes"]; + $this->date_format = $user["date_format"]; + $this->date_sep = $user["date_sep"]; + $this->tho_sep = $user["tho_sep"]; + $this->dec_sep = $user["dec_sep"]; + $this->theme = $user["theme"]; + $this->pagesize = $user["page_size"]; + $this->show_hints = $user["show_hints"]; + $this->print_profile = $user["print_profile"]; + $this->rep_popup = $user["rep_popup"]; + $this->query_size = $user["query_size"]; + $this->graphic_links = $user["graphic_links"]; + } } function language()