changed: added Cur structure
we have there two pointers: Request * request; Session * session; these are the current request and the current session the session GC was moved to SessionManager (was in SessionContainer) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -31,9 +31,9 @@ CKEditorGetParser ckeditor_getparser;
|
||||
std::vector<std::wstring> empty_pars;
|
||||
const std::wstring empty_string;
|
||||
|
||||
Config * config;
|
||||
Request * request;
|
||||
Db * db;
|
||||
Cur * cur;
|
||||
Config * config;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
SessionManager * session_manager;
|
||||
@@ -42,14 +42,14 @@ SessionManager * session_manager;
|
||||
|
||||
Ezc::Pattern * content_for_function()
|
||||
{
|
||||
if( !request->function )
|
||||
if( !cur->request->function )
|
||||
{
|
||||
log << log1 << "Templates: no function" << logend;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const size_t loc_index = static_cast<size_t>(locale.GetLang());
|
||||
const size_t fun_id = static_cast<size_t>(request->function->id);
|
||||
const size_t fun_id = static_cast<size_t>(cur->request->function->id);
|
||||
|
||||
if( loc_index >= patterns_fun.size() || fun_id >= patterns_fun[loc_index].size() )
|
||||
{
|
||||
@@ -73,7 +73,7 @@ Ezc::Pattern * p = 0;
|
||||
}
|
||||
|
||||
|
||||
switch( request->status )
|
||||
switch( cur->request->status )
|
||||
{
|
||||
//case WINIX_ERR_NO_ITEM: !! we need something like 'error::item_required'
|
||||
//p = &pat_err_item_required;
|
||||
@@ -586,15 +586,15 @@ using namespace TemplatesFunctions;
|
||||
Ezc::Pattern * index = 0;
|
||||
const std::wstring * index_file_local = 0;
|
||||
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
if( !request->item.html_template.empty() )
|
||||
index_file_local = &request->item.html_template;
|
||||
if( !cur->request->item.html_template.empty() )
|
||||
index_file_local = &cur->request->item.html_template;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !request->dir_tab.back()->html_template.empty() )
|
||||
index_file_local = &request->dir_tab.back()->html_template;
|
||||
if( !cur->request->dir_tab.back()->html_template.empty() )
|
||||
index_file_local = &cur->request->dir_tab.back()->html_template;
|
||||
}
|
||||
|
||||
|
||||
@@ -616,8 +616,8 @@ using namespace TemplatesFunctions;
|
||||
index = &patterns[locale.GetLang()][pat_index];
|
||||
|
||||
EzcGen generator;
|
||||
//generator.Generate(request->page, *index, ezc_functions);
|
||||
generator.Generate(request->page, *index);
|
||||
//generator.Generate(cur->request->page, *index, ezc_functions);
|
||||
generator.Generate(cur->request->page, *index);
|
||||
}
|
||||
|
||||
|
||||
@@ -629,7 +629,7 @@ using namespace TemplatesFunctions;
|
||||
if( !empty_pars.empty() )
|
||||
empty_pars.clear();
|
||||
|
||||
Info info(request->page, empty_pars, empty_string);
|
||||
Info info(cur->request->page, empty_pars, empty_string);
|
||||
|
||||
info.iter = 0;
|
||||
info.res = false;
|
||||
@@ -645,12 +645,13 @@ void Templates::SetConfig(Config * pconfig)
|
||||
}
|
||||
|
||||
|
||||
void Templates::SetRequest(Request * prequest)
|
||||
void Templates::SetCur(Cur * pcur)
|
||||
{
|
||||
TemplatesFunctions::request = prequest;
|
||||
TemplatesFunctions::cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Templates::SetDb(Db * pdb)
|
||||
{
|
||||
TemplatesFunctions::db = pdb;
|
||||
|
||||
Reference in New Issue
Block a user