updated to the new api from ezc: changed semantic of [def] and Vars moved outside of Generator

This commit is contained in:
2021-05-23 10:14:08 +02:00
parent d30c7254eb
commit 61fe6ea219
3 changed files with 40 additions and 18 deletions

View File

@@ -47,7 +47,7 @@ namespace TemplatesFunctions
extern EzcFun ezc_functions;
extern Ezc::Blocks ezc_blocks;
extern Ezc::Vars ezc_vars;
void HtmlEscapeFormTxt(HtmlTextStream & out, const std::wstring & in)
@@ -107,6 +107,7 @@ void InitGenerator(EzcGen & gen)
*/
gen.SetBlocks(ezc_blocks);
gen.SetFunctions(ezc_functions);
gen.SetVariables(ezc_vars);
}

View File

@@ -62,6 +62,7 @@ Locale locale; // IMPROVE ME will be moved to a better place
EzcFun ezc_functions;
Ezc::Blocks ezc_blocks;
Ezc::Objects<HtmlTextStream> ezc_objects;
Ezc::Vars ezc_vars;
LocaleFilter locale_filter;
HTMLFilter html_filter;
@@ -1118,6 +1119,7 @@ void Templates::Generate()
{
using namespace TemplatesFunctions;
ezc_vars.clear();
Ezc::Pattern * index = SelectIndexPattern();
if( index )
@@ -1140,6 +1142,7 @@ void Templates::Generate(Ezc::Pattern & pattern)
{
using namespace TemplatesFunctions;
ezc_vars.clear();
InitGenerator(generator);
generator.SetPattern(pattern);
generator.Generate(cur->request->out_main_stream, cur->request->out_streams);