added: winix functions: locale, timezone
changed: time zones -- now we have the daylight saving time
different for each year (start, end)
added: config option: time_zone_id (size_t)
time zone identifier for not logged users
or for newly created accounts
those identifiers you can see in etc/time_zones.conf file
or by using timezone winix function with 'a' parameter (timezone/a) (!!IMPROVE ME NOT IMPLEMENTED YET)
default: 34 (Coordinated Universal Time UTC+00:00)
added: config option: locale_default_id (size_t)
locale for not logged users
or for newly created accounts
added: config option: locale_max_id (size_t)
a maximum value of a locale identifier
default: 100 (maximum: 1000)
each locale files should have its own identifier (in "winix_locale_id" field)
from zero to this value
added: config option: time_zone_max_id (size_t)
maximum value of a time zone identifier
time zones with an id greater than this will be skipped
default: 130 (maximum: 1000)
removed: config option: locale_default
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@852 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -72,12 +72,12 @@ static std::wstring fun_file;
|
||||
fun_file += cur->request->function->fun.url;
|
||||
fun_file += config->templates_fun_postfix;
|
||||
|
||||
Ezc::Pattern * p = change_patterns.Get(cur->mount->dir_id, fun_file, locale.GetLang());
|
||||
Ezc::Pattern * p = change_patterns.Get(cur->mount->dir_id, fun_file, locale.GetCurLang());
|
||||
|
||||
if( p )
|
||||
return p;
|
||||
|
||||
return patterns.Get(cur->request->function->template_index, locale.GetLang());
|
||||
return patterns.Get(cur->request->function->template_index, locale.GetCurLang());
|
||||
}
|
||||
|
||||
|
||||
@@ -99,14 +99,14 @@ Ezc::Pattern * p = 0;
|
||||
case WINIX_ERR_CANT_CHANGE_GROUP:
|
||||
case WINIX_ERR_CANT_CHANGE_PRIVILEGES:
|
||||
// !! locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika
|
||||
p = patterns.Get(pat_err_per_denied, locale.GetLang());
|
||||
p = patterns.Get(pat_err_per_denied, locale.GetCurLang());
|
||||
break;
|
||||
|
||||
case WINIX_ERR_NO_ITEM:
|
||||
case WINIX_ERR_NO_FUNCTION:
|
||||
case WINIX_ERR_UNKNOWN_PARAM:
|
||||
// !! locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika
|
||||
p = patterns.Get(pat_err_404, locale.GetLang());
|
||||
p = patterns.Get(pat_err_404, locale.GetCurLang());
|
||||
break;
|
||||
|
||||
//default:
|
||||
@@ -507,6 +507,13 @@ void Templates::CreateFunctions()
|
||||
ezc_functions.Insert("user_can_use_html", user_can_use_html);
|
||||
ezc_functions.Insert("user_can_use_bbcode", user_can_use_bbcode);
|
||||
ezc_functions.Insert("user_can_use_raw", user_can_use_raw);
|
||||
ezc_functions.Insert("user_has_correct_time_zone",user_has_correct_time_zone);
|
||||
ezc_functions.Insert("user_time_zone_name", user_time_zone_name);
|
||||
ezc_functions.Insert("user_time_zone_id", user_time_zone_id);
|
||||
ezc_functions.Insert("user_time_zone_offset_hour_min", user_time_zone_offset_hour_min);
|
||||
ezc_functions.Insert("user_has_correct_locale", user_has_correct_locale);
|
||||
ezc_functions.Insert("user_locale_name", user_locale_name);
|
||||
ezc_functions.Insert("user_locale_id", user_locale_id);
|
||||
ezc_functions.Insert("user_tab", user_tab);
|
||||
ezc_functions.Insert("user_tab_index", user_tab_index);
|
||||
ezc_functions.Insert("user_tab_id", user_tab_id);
|
||||
@@ -573,11 +580,9 @@ void Templates::CreateFunctions()
|
||||
ezc_functions.Insert("winix_tz_tab_name", winix_tz_tab_name);
|
||||
ezc_functions.Insert("winix_tz_tab_offset_sec", winix_tz_tab_offset_sec);
|
||||
ezc_functions.Insert("winix_tz_tab_offset_hour_min", winix_tz_tab_offset_hour_min);
|
||||
ezc_functions.Insert("winix_tz_tab_has_dst", winix_tz_tab_has_dst);
|
||||
ezc_functions.Insert("winix_tz_tab_dst_offset_sec", winix_tz_tab_dst_offset_sec);
|
||||
ezc_functions.Insert("winix_tz_tab_dst_offset_hour_min", winix_tz_tab_dst_offset_hour_min);
|
||||
ezc_functions.Insert("winix_tz_tab_dst_start", winix_tz_tab_dst_start);
|
||||
ezc_functions.Insert("winix_tz_tab_dst_end", winix_tz_tab_dst_end);
|
||||
ezc_functions.Insert("winix_locale_tab", winix_locale_tab);
|
||||
ezc_functions.Insert("winix_locale_tab_id", winix_locale_tab_id);
|
||||
ezc_functions.Insert("winix_locale_tab_name", winix_locale_tab_name);
|
||||
|
||||
|
||||
/*
|
||||
@@ -612,9 +617,8 @@ using namespace TemplatesFunctions;
|
||||
|
||||
locale.UTF8(config->utf8);
|
||||
locale.SetLocaleFiles(config->locale_files);
|
||||
// !! tutaj nie potrzeba ustawiac locali SetLang/SetLangDef (nie odczytujemy kluczy)
|
||||
locale.SetLang(config->locale_default_index); // !! w przyszlosci locale beda ustawiane dla kazdego uzytkownika osobno
|
||||
locale.SetLangDef(config->locale_default_index);
|
||||
locale.SetLocaleMaxId(config->locale_max_id);
|
||||
locale.SetDefLang(config->locale_default_id);
|
||||
locale.Read(config->locale_dir, config->locale_dir_default);
|
||||
|
||||
log << log3 << "Templates: there are " << locale.Size() << " locales" << logend;
|
||||
@@ -682,6 +686,8 @@ using namespace TemplatesFunctions;
|
||||
|
||||
|
||||
|
||||
// !! IMPROVE ME
|
||||
// we need such a html filter for each language (orphans are different in each language)
|
||||
void Templates::SetHtmlFilter()
|
||||
{
|
||||
using namespace TemplatesFunctions;
|
||||
@@ -701,6 +707,9 @@ using namespace TemplatesFunctions;
|
||||
if( locale.IsKeyLang(L"html_lang_attr_value", i) &&
|
||||
locale.IsKeyLangList(L"language_orphans", i) )
|
||||
{
|
||||
// !! FIX ME
|
||||
// this is not the proper index
|
||||
// we should use locale.GetByIndex() instead
|
||||
html_filter.AssignOrphans(locale.Get(L"html_lang_attr_value", i),
|
||||
locale.GetList(L"language_orphans", i));
|
||||
}
|
||||
@@ -835,7 +844,7 @@ using namespace TemplatesFunctions;
|
||||
}
|
||||
|
||||
if( index_file_local && *index_file_local != config->templates_index )
|
||||
index = index_patterns.Get(*index_file_local, locale.GetLang());
|
||||
index = index_patterns.Get(*index_file_local, locale.GetCurLang());
|
||||
|
||||
return index;
|
||||
}
|
||||
@@ -851,18 +860,18 @@ using namespace TemplatesFunctions;
|
||||
Ezc::Pattern * index = 0;
|
||||
|
||||
if( cur->request->IsParam(L"rawcontent") )
|
||||
index = patterns.Get(pat_index_rawcontent, locale.GetLang());
|
||||
index = patterns.Get(pat_index_rawcontent, locale.GetCurLang());
|
||||
else
|
||||
if( cur->request->IsParam(L"fullscreen") )
|
||||
index = patterns.Get(pat_index_fullscreen, locale.GetLang());
|
||||
index = patterns.Get(pat_index_fullscreen, locale.GetCurLang());
|
||||
else
|
||||
index = SelectIndexPatternFromItemAndMountPoint();
|
||||
|
||||
if( !index )
|
||||
index = change_patterns.Get(cur->mount->dir_id, config->templates_index, locale.GetLang());
|
||||
index = change_patterns.Get(cur->mount->dir_id, config->templates_index, locale.GetCurLang());
|
||||
|
||||
if( !index )
|
||||
index = patterns.Get(pat_index, locale.GetLang());;
|
||||
index = patterns.Get(pat_index, locale.GetCurLang());;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user