allow to use multiple directories in html and txt templates
remove from the config: templates_dir, templates_dir_default, txt_templates_dir, txt_templates_dir_default add to the config: html_templates_dirs - a list of directories with html templates txt_templates_dirs - a list of directories with txt templates We search from the last directory to the first one.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011-2015, Tomasz Sowa
|
||||
/*
|
||||
* Copyright (c) 2011-2026, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -59,13 +59,16 @@ void Patterns::SetDeleteWhiteItems(bool del_white)
|
||||
}
|
||||
|
||||
|
||||
void Patterns::SetDirectories(const std::wstring & tmpl_dir, const std::wstring & tmpl_dir_def)
|
||||
void Patterns::SetDirectories(const std::vector<std::wstring> & tmpl_dirs)
|
||||
{
|
||||
templates_dir = tmpl_dir;
|
||||
templates_dir_def = tmpl_dir_def;
|
||||
templates_dirs = tmpl_dirs;
|
||||
}
|
||||
|
||||
|
||||
void Patterns::ClearDirectories()
|
||||
{
|
||||
templates_dirs.clear();
|
||||
}
|
||||
|
||||
|
||||
void Patterns::SetLocale(Locale * plocale)
|
||||
@@ -138,7 +141,7 @@ void Patterns::ReadPatterns(Template & templ)
|
||||
* pattern_parser.SetCommentary() is set beforehand
|
||||
*/
|
||||
pattern_parser.DeleteWhiteTextItems(del_white_items);
|
||||
pattern_parser.Directory(templates_dir, templates_dir_def);
|
||||
pattern_parser.SetDirectories(templates_dirs);
|
||||
pattern_parser.SetLogger(&log);
|
||||
|
||||
if( ezc_blocks )
|
||||
|
||||
Reference in New Issue
Block a user