added: two options to the config:
ezc_error_prefix (string)
ezc_error_postfix (string)
// prefix and postfix used when there is an error in Ezc patterns
// default:
// prefix: "<!-- "
// postfix: " -->"
added: Ezc::Blocks to templates
added: although patterns have pointers to functions and blocks cached
the Ezc::Generator should use SetFunctions() and SetBlocks() method
in order to correctly recognize variables (aliases)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@978 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -207,6 +207,7 @@ void NotifyThread::SendMail()
|
||||
|
||||
Lock();
|
||||
// 'patterns' object can use logger or other stuff so we use Lock() before
|
||||
|
||||
Ezc::Pattern * pat = patterns.Get(template_index, lang_id);
|
||||
|
||||
if( !pat )
|
||||
@@ -221,13 +222,22 @@ void NotifyThread::SendMail()
|
||||
generator.RecognizeSpecialChars(true);
|
||||
generator.TrimWhite(true);
|
||||
generator.SkipNewLine(true);
|
||||
/*
|
||||
* !! IMPROVE ME
|
||||
* add blocks and variables
|
||||
* hmm may they are not needed here?
|
||||
*/
|
||||
generator.SetFunctions(TemplatesNotifyFunctions::ezc_functions);
|
||||
generator.SetPattern(*pat);
|
||||
|
||||
/*
|
||||
* don't use cache
|
||||
* 'pat' pattern is stored in 'patterns' object for all templates and by default
|
||||
* all functions/blocks are cached, but we are in a second thread
|
||||
* and cannot use such functions without locking
|
||||
*
|
||||
* IMPROVE ME
|
||||
* blocks are parsed to the container from the main thread
|
||||
* and we cannot just use it here (another thread)
|
||||
* so may should we have our own 'patterns' object here?
|
||||
*
|
||||
*/
|
||||
generator.CanUseCache(false);
|
||||
generator.Generate(notify_stream);
|
||||
|
||||
SendMail(TemplatesNotifyFunctions::notify_user_msg.email, notify_stream.Str());
|
||||
|
||||
Reference in New Issue
Block a user