changed: rename cmslu to winix
changed: html templates are a part of winix now
and the user can provide special html templates for its site
added: locales
added: html templates are using HtmlFilter now (locales)
changed: now we have html templates for each language
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@560 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
dir.o: templates.h patterncacher.h ../core/item.h ../core/request.h
|
||||
dir.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
dir.o: ../core/locale.h ../confparser/confparser.h ../core/request.h
|
||||
dir.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
dir.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
dir.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
@@ -9,63 +10,80 @@ dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
dir.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
dir.o: ../core/mount.h ../core/db.h ../core/log.h ../core/misc.h
|
||||
doc.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
dir.o: ../core/mount.h ../core/locale.h ../core/db.h ../core/log.h
|
||||
dir.o: ../core/misc.h
|
||||
doc.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
doc.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
doc.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
doc.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
doc.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
doc.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
doc.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
doc.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
doc.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
doc.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
done.o: templates.h patterncacher.h ../core/item.h ../core/request.h
|
||||
done.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
done.o: ../core/locale.h ../confparser/confparser.h ../core/request.h
|
||||
done.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
done.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
done.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
done.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
done.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
done.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
item.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
item.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
item.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
item.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
item.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
item.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
item.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
item.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
item.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
item.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
item.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
last.o: templates.h patterncacher.h ../core/item.h ../core/lastcontainer.h
|
||||
last.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
last.o: ../core/locale.h ../confparser/confparser.h ../core/lastcontainer.h
|
||||
last.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
last.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
last.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
last.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
last.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||
last.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
last.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
last.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
last.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
mount.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
last.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
last.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
last.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||
last.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
last.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
last.o: ../core/misc.h
|
||||
localefilter.o: localefilter.h ../core/locale.h ../confparser/confparser.h
|
||||
localefilter.o: ../core/misc.h ../core/item.h
|
||||
misc.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
misc.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
misc.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
misc.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
misc.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
misc.o: ../core/misc.h misc.h localefilter.h ../core/locale.h
|
||||
misc.o: ../confparser/confparser.h
|
||||
mount.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
mount.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
mount.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
mount.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
mount.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
mount.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
mount.o: ../core/error.h ../core/rebus.h
|
||||
mount.o: ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
patterncacher.o: patterncacher.h ../core/item.h ../core/data.h ../core/dirs.h
|
||||
patterncacher.o: ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
patterncacher.o: ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
patterncacher.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
patterncacher.o: ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
patterncacher.o: ../core/log.h
|
||||
priv.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
patterncacher.o: ../core/locale.h ../core/log.h
|
||||
priv.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
priv.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
priv.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
priv.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
priv.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
priv.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
priv.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
priv.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
@@ -79,60 +97,71 @@ rebus.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||
rebus.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
rebus.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
rebus.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
rebus.o: ../core/mount.h templates.h patterncacher.h ../core/item.h
|
||||
sys.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
rebus.o: ../core/mount.h ../core/locale.h templates.h patterncacher.h
|
||||
rebus.o: ../core/item.h misc.h localefilter.h ../core/locale.h
|
||||
rebus.o: ../confparser/confparser.h
|
||||
sys.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
sys.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
sys.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
sys.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
sys.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
sys.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
sys.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
sys.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
sys.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
sys.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
templates.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
templates.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
templates.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
templates.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
templates.o: ../core/users.h ../core/user.h ../core/ugcontainer.h
|
||||
templates.o: ../core/log.h ../core/groups.h ../core/group.h
|
||||
templates.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||
templates.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
templates.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
templates.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||
templates.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
templates.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
templates.o: ../core/misc.h ../core/plugin.h ../core/request.h ../core/data.h
|
||||
templates.o: ../core/locale.h ../core/request.h ../core/requesttypes.h
|
||||
templates.o: ../core/session.h ../core/done.h ../core/thread.h
|
||||
templates.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
templates.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
templates.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
templates.o: ../core/plugin.h ../core/request.h ../core/data.h
|
||||
templates.o: ../core/pluginmsg.h
|
||||
thread.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
thread.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
thread.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
thread.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
thread.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
thread.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
thread.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
thread.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||
thread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
thread.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
ticket.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
thread.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
thread.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
thread.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||
thread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
thread.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
thread.o: ../core/misc.h
|
||||
ticket.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
ticket.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
ticket.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
ticket.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
ticket.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
ticket.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
ticket.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||
ticket.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
ticket.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
ticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
user.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
ticket.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
ticket.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
ticket.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||
ticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
ticket.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
ticket.o: ../core/misc.h
|
||||
user.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
user.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
user.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
user.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
user.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
user.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
user.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
user.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
user.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
user.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
user.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
who.o: templates.h patterncacher.h ../core/item.h ../core/sessioncontainer.h
|
||||
who.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
who.o: ../core/locale.h ../confparser/confparser.h ../core/sessioncontainer.h
|
||||
who.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
who.o: ../core/log.h ../core/user.h ../core/rebus.h
|
||||
who.o: ../core/requestcontroller.h ../content/content.h
|
||||
@@ -142,7 +171,7 @@ who.o: ../core/functionparser.h ../core/requesttypes.h ../core/data.h
|
||||
who.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
who.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
who.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||
who.o: ../core/mounts.h ../core/mount.h ../core/request.h ../core/thread.h
|
||||
who.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
who.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/request.h
|
||||
who.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
who.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
who.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
|
||||
@@ -1 +1 @@
|
||||
o = dir.o doc.o done.o item.o last.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o user.o who.o
|
||||
o = dir.o doc.o done.o item.o last.o localefilter.o misc.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o user.o who.o
|
||||
|
||||
@@ -228,7 +228,10 @@ void dir_last_subject(Info & i)
|
||||
|
||||
void dir_last_info(Info & i)
|
||||
{
|
||||
Ezc::Generator gen(i.out, pat_dir_last_info, functions);
|
||||
if( static_cast<size_t>(data.locale.GetLang()) >= patterns.size() )
|
||||
return;
|
||||
|
||||
Ezc::Generator gen(i.out, patterns[data.locale.GetLang()][pat_dir_last_info], functions);
|
||||
gen.Generate();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,6 @@ namespace TemplatesFunctions
|
||||
|
||||
|
||||
|
||||
void doc_language(Info & i)
|
||||
{
|
||||
// at the moment only Polish language
|
||||
i.out << "pl";
|
||||
}
|
||||
|
||||
|
||||
|
||||
void doc_title(Info & i)
|
||||
{
|
||||
@@ -49,11 +42,6 @@ void doc_title(Info & i)
|
||||
|
||||
|
||||
|
||||
void doc_charset(Info & i)
|
||||
{
|
||||
i.out << "iso-8859-2";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -190,7 +190,10 @@ void item_can_write(Info & i)
|
||||
|
||||
void item_info(Info & i)
|
||||
{
|
||||
Ezc::Generator gen(i.out, pat_item_info, functions);
|
||||
if( static_cast<size_t>(data.locale.GetLang()) >= patterns.size() )
|
||||
return;
|
||||
|
||||
Ezc::Generator gen(i.out, patterns[data.locale.GetLang()][pat_item_info], functions);
|
||||
gen.Generate();
|
||||
}
|
||||
|
||||
@@ -448,7 +451,10 @@ void item_tab_can_read(Info & i)
|
||||
|
||||
void item_tab_info(Info & i)
|
||||
{
|
||||
Ezc::Generator gen(i.out, pat_item_tab_info, functions);
|
||||
if( static_cast<size_t>(data.locale.GetLang()) >= patterns.size() )
|
||||
return;
|
||||
|
||||
Ezc::Generator gen(i.out, patterns[data.locale.GetLang()][pat_item_tab_info], functions);
|
||||
gen.Generate();
|
||||
}
|
||||
|
||||
|
||||
117
templates/localefilter.cpp
Executable file
117
templates/localefilter.cpp
Executable file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "localefilter.h"
|
||||
#include "../core/misc.h"
|
||||
|
||||
|
||||
|
||||
LocaleFilter::LocaleFilter()
|
||||
{
|
||||
open_mark = '{';
|
||||
closing_mark = '}';
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LocaleFilter::ReadKey()
|
||||
{
|
||||
key.clear();
|
||||
|
||||
for( ; *pchar && *pchar != closing_mark ; ++pchar)
|
||||
key += *pchar;
|
||||
|
||||
// skipping last closing mark (if exists)
|
||||
if( *pchar == closing_mark )
|
||||
++pchar;
|
||||
|
||||
TrimWhite(key);
|
||||
}
|
||||
|
||||
|
||||
std::string & LocaleFilter::FilterValue(const std::string & in)
|
||||
{
|
||||
value.clear();
|
||||
const char * p = in.c_str();
|
||||
|
||||
while( *p )
|
||||
{
|
||||
if( *p == '\\' && (*(p+1) == 'n') )
|
||||
{
|
||||
value += '\n';
|
||||
p += 2;
|
||||
}
|
||||
else
|
||||
if( *p == '\\' && (*(p+1) == '\\') )
|
||||
{
|
||||
value += '\\';
|
||||
p += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
value += *p;
|
||||
p += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LocaleFilter::Parse(std::string & str)
|
||||
{
|
||||
res.clear();
|
||||
pchar = str.c_str();
|
||||
|
||||
while( *pchar )
|
||||
{
|
||||
if( *pchar == open_mark )
|
||||
{
|
||||
++pchar;
|
||||
ReadKey();
|
||||
res += FilterValue(plocale->Get(key));
|
||||
}
|
||||
else
|
||||
if( *pchar == '\\' && (*(pchar+1) == open_mark || *(pchar+1) == closing_mark || *(pchar+1) == '\\') )
|
||||
{
|
||||
res += *(pchar+1);
|
||||
pchar += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
res += *pchar;
|
||||
pchar += 1;
|
||||
}
|
||||
}
|
||||
|
||||
str = res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void LocaleFilter::FilterText(Ezc::Pattern::Item & item)
|
||||
{
|
||||
if( !item.text.empty() )
|
||||
Parse(item.text);
|
||||
|
||||
std::vector<Ezc::Pattern::Item*>::iterator i = item.item_table.begin();
|
||||
|
||||
for( ; i != item.item_table.end() ; ++i )
|
||||
FilterText(**i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LocaleFilter::Filter(Ezc::Pattern & pattern, const Locale & locale)
|
||||
{
|
||||
plocale = &locale;
|
||||
FilterText( pattern.item_root );
|
||||
}
|
||||
46
templates/localefilter.h
Executable file
46
templates/localefilter.h
Executable file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslutemplateslocalefilter
|
||||
#define headerfilecmslutemplateslocalefilter
|
||||
|
||||
|
||||
#include "../core/locale.h"
|
||||
#include "ezc.h"
|
||||
|
||||
|
||||
|
||||
class LocaleFilter
|
||||
{
|
||||
public:
|
||||
|
||||
LocaleFilter();
|
||||
void Filter(Ezc::Pattern & pattern, const Locale & locale);
|
||||
|
||||
private:
|
||||
void ReadKey();
|
||||
std::string & FilterValue(const std::string & in);
|
||||
void FilterText(Ezc::Pattern::Item & item);
|
||||
void Parse(std::string & str);
|
||||
|
||||
char open_mark; // default '{'
|
||||
char closing_mark; // default '}'
|
||||
|
||||
const Locale * plocale;
|
||||
std::string res;
|
||||
std::string key;
|
||||
std::string value;
|
||||
const char * pchar;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
88
templates/misc.cpp
Executable file
88
templates/misc.cpp
Executable file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "../core/data.h"
|
||||
#include "../core/misc.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
namespace TemplatesMisc
|
||||
{
|
||||
|
||||
// those functions from here are used in the second thread too
|
||||
|
||||
|
||||
void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const std::string & dir, const char * file, bool delete_white)
|
||||
{
|
||||
size_t i;
|
||||
size_t len = patterns.size();
|
||||
Locale::Lang old_lang = data.locale.GetLang();
|
||||
|
||||
|
||||
for(i=0 ; i<len ; ++i)
|
||||
{
|
||||
if( pat < patterns[i].size() )
|
||||
{
|
||||
patterns[i][pat].delete_all_white = delete_white;
|
||||
patterns[i][pat].Directory(dir);
|
||||
patterns[i][pat].ParseFile(file);
|
||||
|
||||
Locale::Lang new_lang = static_cast<Locale::Lang>(i);
|
||||
data.locale.SetLang(new_lang);
|
||||
|
||||
locale_filter.Filter(patterns[i][pat], data.locale);
|
||||
|
||||
log << "Read pattern: " << dir << "/" << file << " for lang: " << data.locale.LangToStr(new_lang) << logend;
|
||||
}
|
||||
}
|
||||
|
||||
data.locale.SetLang(old_lang);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const char * file, bool delete_white)
|
||||
{
|
||||
std::string temp = data.templates_dir;
|
||||
temp += '/';
|
||||
temp += file;
|
||||
|
||||
|
||||
if( IsFile(temp) )
|
||||
{
|
||||
Read(patterns, pat, locale_filter, data.templates_dir, file, delete_white);
|
||||
}
|
||||
else
|
||||
{
|
||||
Read(patterns, pat, locale_filter, data.templates_dir_default, file, delete_white);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ClearPatterns(Patterns & patterns, size_t len)
|
||||
{
|
||||
size_t loc, pat;
|
||||
|
||||
patterns.resize(Locale::lang_unknown);
|
||||
|
||||
for(loc=0 ; loc < static_cast<size_t>(Locale::lang_unknown) ; ++loc)
|
||||
{
|
||||
patterns[loc].resize(len);
|
||||
|
||||
for(pat=0 ; pat<len ; ++pat)
|
||||
patterns[loc][pat].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace TemplatesMisc
|
||||
|
||||
|
||||
40
templates/misc.h
Executable file
40
templates/misc.h
Executable file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslutemplatesmisc
|
||||
#define headerfilecmslutemplatesmisc
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "localefilter.h"
|
||||
#include "ezc.h"
|
||||
|
||||
|
||||
|
||||
|
||||
namespace TemplatesMisc
|
||||
{
|
||||
|
||||
typedef std::vector<std::vector<Ezc::Pattern> > Patterns;
|
||||
|
||||
|
||||
|
||||
// those functions from here are used in the second thread too
|
||||
|
||||
void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const std::string & dir, const char * file, bool delete_white = false);
|
||||
void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const char * file, bool delete_white = false);
|
||||
void ClearPatterns(Patterns & patterns, size_t len);
|
||||
|
||||
|
||||
|
||||
} // namespace TemplatesMisc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
#include "localefilter.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/request.h"
|
||||
#include "../core/misc.h"
|
||||
@@ -16,37 +17,11 @@
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
Ezc::Pattern pat_index;
|
||||
Ezc::Pattern pat_fun_cat;
|
||||
Ezc::Pattern pat_fun_ls;
|
||||
Ezc::Pattern pat_fun_emacs;
|
||||
Ezc::Pattern pat_fun_mkdir;
|
||||
Ezc::Pattern pat_fun_default;
|
||||
Ezc::Pattern pat_fun_priv;
|
||||
Ezc::Pattern pat_fun_rm;
|
||||
Ezc::Pattern pat_fun_who;
|
||||
Ezc::Pattern pat_fun_run;
|
||||
Ezc::Pattern pat_fun_last;
|
||||
Ezc::Pattern pat_fun_thread;
|
||||
Ezc::Pattern pat_fun_reload;
|
||||
Ezc::Pattern pat_fun_createthread;
|
||||
Ezc::Pattern pat_fun_upload;
|
||||
Ezc::Pattern pat_fun_ticket;
|
||||
Ezc::Pattern pat_fun_createticket;
|
||||
Ezc::Pattern pat_err_item_required;
|
||||
Ezc::Pattern pat_err_404;
|
||||
Ezc::Pattern pat_err_per_denied;
|
||||
Ezc::Pattern pat_err_others;
|
||||
Ezc::Pattern pat_item_info;
|
||||
Ezc::Pattern pat_item_tab_info;
|
||||
Ezc::Pattern pat_dir_last_info;
|
||||
|
||||
|
||||
TemplatesMisc::Patterns patterns;
|
||||
Ezc::Functions functions;
|
||||
|
||||
|
||||
PatternCacher pattern_cacher;
|
||||
|
||||
PatternCacher pattern_cacher;
|
||||
LocaleFilter locale_filter;
|
||||
|
||||
|
||||
|
||||
@@ -60,86 +35,44 @@ Ezc::Pattern * content_for_function()
|
||||
{
|
||||
Ezc::Pattern * p = 0;
|
||||
|
||||
|
||||
if( !request.pfunction )
|
||||
{
|
||||
log << log1 << "Templates: no function" << logend;
|
||||
return p;
|
||||
}
|
||||
|
||||
static PatName pat_name_tab[] = {
|
||||
{FUN_CAT, pat_fun_cat},
|
||||
{FUN_LS, pat_fun_ls},
|
||||
{FUN_RM, pat_fun_rm},
|
||||
{FUN_EMACS, pat_fun_emacs},
|
||||
{FUN_MKDIR, pat_fun_mkdir},
|
||||
{FUN_DEFAULT, pat_fun_default},
|
||||
{FUN_PRIV, pat_fun_priv},
|
||||
{FUN_RUN, pat_fun_run},
|
||||
{FUN_WHO, pat_fun_who},
|
||||
{FUN_LAST, pat_fun_last},
|
||||
{FUN_THREAD, pat_fun_thread},
|
||||
{FUN_RELOAD, pat_fun_reload},
|
||||
{FUN_CREATETHREAD, pat_fun_createthread},
|
||||
{FUN_TICKET, pat_fun_ticket},
|
||||
{FUN_CREATETICKET, pat_fun_createticket},
|
||||
{FUN_EDITTICKET, pat_fun_createticket},
|
||||
{FUN_UPLOAD, pat_fun_upload}
|
||||
};
|
||||
|
||||
switch( request.pfunction->code )
|
||||
size_t i, len = sizeof(pat_name_tab)/sizeof(PatName);
|
||||
|
||||
for(i=0 ; i<len ; ++i)
|
||||
{
|
||||
case FUN_CAT:
|
||||
p = &pat_fun_cat;
|
||||
break;
|
||||
|
||||
case FUN_LS:
|
||||
p = &pat_fun_ls;
|
||||
break;
|
||||
|
||||
case FUN_RM:
|
||||
p = &pat_fun_rm;
|
||||
break;
|
||||
|
||||
case FUN_EMACS:
|
||||
p = &pat_fun_emacs;
|
||||
break;
|
||||
|
||||
case FUN_MKDIR:
|
||||
p = &pat_fun_mkdir;
|
||||
break;
|
||||
|
||||
case FUN_DEFAULT:
|
||||
p = &pat_fun_default;
|
||||
break;
|
||||
|
||||
case FUN_PRIV:
|
||||
p = &pat_fun_priv;
|
||||
break;
|
||||
|
||||
case FUN_RUN:
|
||||
p = &pat_fun_run;
|
||||
break;
|
||||
|
||||
case FUN_WHO:
|
||||
p = &pat_fun_who;
|
||||
break;
|
||||
|
||||
case FUN_LAST:
|
||||
p = &pat_fun_last;
|
||||
break;
|
||||
|
||||
case FUN_THREAD:
|
||||
p = &pat_fun_thread;
|
||||
break;
|
||||
|
||||
case FUN_RELOAD:
|
||||
p = &pat_fun_reload;
|
||||
break;
|
||||
|
||||
case FUN_CREATETHREAD:
|
||||
p = &pat_fun_createthread;
|
||||
break;
|
||||
|
||||
case FUN_TICKET:
|
||||
p = &pat_fun_ticket;
|
||||
break;
|
||||
|
||||
case FUN_CREATETICKET:
|
||||
case FUN_EDITTICKET:
|
||||
p = &pat_fun_createticket;
|
||||
break;
|
||||
|
||||
case FUN_UPLOAD:
|
||||
p = &pat_fun_upload;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
if( pat_name_tab[i].fun_code == request.pfunction->code )
|
||||
{
|
||||
// !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika
|
||||
p = &patterns[data.locale.GetLang()][pat_name_tab[i].pat];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -149,6 +82,13 @@ void content(Info & i)
|
||||
{
|
||||
Ezc::Pattern * p = 0;
|
||||
|
||||
if( static_cast<size_t>(data.locale.GetLang()) >= patterns.size() )
|
||||
{
|
||||
log << log1 << "Templates: there is no such a language in patterns" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch( request.status )
|
||||
{
|
||||
case Error::ok:
|
||||
@@ -165,17 +105,20 @@ Ezc::Pattern * p = 0;
|
||||
case Error::cant_change_user:
|
||||
case Error::cant_change_group:
|
||||
case Error::cant_change_privileges:
|
||||
p = &pat_err_per_denied;
|
||||
// !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika
|
||||
p = &patterns[data.locale.GetLang()][pat_err_per_denied];
|
||||
break;
|
||||
|
||||
case Error::no_item:
|
||||
case Error::no_function:
|
||||
case Error::unknown_param:
|
||||
p = &pat_err_404;
|
||||
// !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika
|
||||
p = &patterns[data.locale.GetLang()][pat_err_404];
|
||||
break;
|
||||
|
||||
default:
|
||||
p = &pat_err_others;
|
||||
// !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika
|
||||
p = &patterns[data.locale.GetLang()][pat_err_others];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -218,9 +161,7 @@ void Templates::CreateFunctions()
|
||||
/*
|
||||
doc
|
||||
*/
|
||||
functions.Insert("doc_language", doc_language);
|
||||
functions.Insert("doc_title", doc_title);
|
||||
functions.Insert("doc_charset", doc_charset);
|
||||
functions.Insert("doc_base_url", doc_base_url);
|
||||
functions.Insert("doc_base_url_static", doc_base_url_static);
|
||||
functions.Insert("doc_base_url_static_auth", doc_base_url_static_auth);
|
||||
@@ -482,90 +423,59 @@ void Templates::CreateFunctions()
|
||||
|
||||
|
||||
|
||||
|
||||
void Templates::ReadTemplates()
|
||||
{
|
||||
using namespace TemplatesFunctions;
|
||||
|
||||
pat_index.Directory(data.templates);
|
||||
pat_index.ParseFile("index.html");
|
||||
|
||||
pat_err_404.Directory(data.templates);
|
||||
pat_err_404.ParseFile("err_404.html");
|
||||
using namespace TemplatesFunctions;
|
||||
using namespace TemplatesMisc;
|
||||
|
||||
pat_err_per_denied.Directory(data.templates);
|
||||
pat_err_per_denied.ParseFile("err_per_denied.html");
|
||||
ClearPatterns();
|
||||
|
||||
pat_fun_cat.Directory(data.templates);
|
||||
pat_fun_cat.ParseFile("fun_cat.html");
|
||||
|
||||
pat_fun_ls.Directory(data.templates);
|
||||
pat_fun_ls.ParseFile("fun_ls.html");
|
||||
|
||||
pat_fun_rm.Directory(data.templates);
|
||||
pat_fun_rm.ParseFile("fun_rm.html");
|
||||
|
||||
pat_err_item_required.Directory(data.templates);
|
||||
pat_err_item_required.ParseFile("err_item_required.html");
|
||||
|
||||
pat_fun_emacs.Directory(data.templates);
|
||||
pat_fun_emacs.ParseFile("fun_emacs.html");
|
||||
|
||||
pat_fun_mkdir.Directory(data.templates);
|
||||
pat_fun_mkdir.ParseFile("fun_mkdir.html");
|
||||
|
||||
pat_fun_default.Directory(data.templates);
|
||||
pat_fun_default.ParseFile("fun_default.html");
|
||||
|
||||
pat_fun_priv.Directory(data.templates);
|
||||
pat_fun_priv.ParseFile("fun_priv.html");
|
||||
|
||||
pat_err_others.Directory(data.templates);
|
||||
pat_err_others.ParseFile("err_others.html");
|
||||
|
||||
pat_fun_who.Directory(data.templates);
|
||||
pat_fun_who.ParseFile("fun_who.html");
|
||||
|
||||
pat_fun_run.Directory(data.templates);
|
||||
pat_fun_run.ParseFile("fun_run.html");
|
||||
|
||||
pat_fun_last.Directory(data.templates);
|
||||
pat_fun_last.ParseFile("fun_last.html");
|
||||
|
||||
pat_item_info.Directory(data.templates);
|
||||
pat_item_info.ParseFile("item_info.html");
|
||||
|
||||
pat_item_tab_info.Directory(data.templates);
|
||||
pat_item_tab_info.ParseFile("item_tab_info.html");
|
||||
|
||||
pat_fun_thread.Directory(data.templates);
|
||||
pat_fun_thread.ParseFile("fun_thread.html");
|
||||
|
||||
pat_fun_createthread.Directory(data.templates);
|
||||
pat_fun_createthread.ParseFile("fun_createthread.html");
|
||||
|
||||
pat_dir_last_info.Directory(data.templates);
|
||||
pat_dir_last_info.ParseFile("dir_last_info.html");
|
||||
|
||||
pat_fun_reload.Directory(data.templates);
|
||||
pat_fun_reload.ParseFile("fun_reload.html");
|
||||
|
||||
pat_fun_upload.Directory(data.templates);
|
||||
pat_fun_upload.ParseFile("fun_upload.html");
|
||||
|
||||
pat_fun_ticket.Directory(data.templates);
|
||||
pat_fun_ticket.ParseFile("fun_ticket.html");
|
||||
|
||||
pat_fun_createticket.Directory(data.templates);
|
||||
pat_fun_createticket.ParseFile("fun_createticket.html");
|
||||
Read(patterns, pat_index, locale_filter, "index.html");
|
||||
Read(patterns, pat_err_404, locale_filter, "err_404.html");
|
||||
Read(patterns, pat_err_per_denied, locale_filter, "err_per_denied.html");
|
||||
Read(patterns, pat_fun_cat, locale_filter, "fun_cat.html");
|
||||
Read(patterns, pat_fun_ls, locale_filter, "fun_ls.html");
|
||||
Read(patterns, pat_fun_rm, locale_filter, "fun_rm.html");
|
||||
Read(patterns, pat_fun_emacs, locale_filter, "fun_emacs.html");
|
||||
Read(patterns, pat_fun_mkdir, locale_filter, "fun_mkdir.html");
|
||||
Read(patterns, pat_fun_default, locale_filter, "fun_default.html");
|
||||
Read(patterns, pat_fun_priv, locale_filter, "fun_priv.html");
|
||||
Read(patterns, pat_err_others, locale_filter, "err_others.html");
|
||||
Read(patterns, pat_fun_who, locale_filter, "fun_who.html");
|
||||
Read(patterns, pat_fun_run, locale_filter, "fun_run.html");
|
||||
Read(patterns, pat_fun_last, locale_filter, "fun_last.html");
|
||||
Read(patterns, pat_item_info, locale_filter, "item_info.html");
|
||||
Read(patterns, pat_item_tab_info, locale_filter, "item_tab_info.html");
|
||||
Read(patterns, pat_fun_thread, locale_filter, "fun_thread.html");
|
||||
Read(patterns, pat_fun_createthread,locale_filter, "fun_createthread.html");
|
||||
Read(patterns, pat_dir_last_info, locale_filter, "dir_last_info.html");
|
||||
Read(patterns, pat_fun_reload, locale_filter, "fun_reload.html");
|
||||
Read(patterns, pat_fun_upload, locale_filter, "fun_upload.html");
|
||||
Read(patterns, pat_fun_ticket, locale_filter, "fun_ticket.html");
|
||||
Read(patterns, pat_fun_createticket,locale_filter, "fun_createticket.html");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Templates::ClearPatterns()
|
||||
{
|
||||
using namespace TemplatesFunctions;
|
||||
|
||||
TemplatesMisc::ClearPatterns(patterns, pat_last);
|
||||
}
|
||||
|
||||
|
||||
void Templates::Generate()
|
||||
{
|
||||
using namespace TemplatesFunctions;
|
||||
|
||||
Ezc::Generator generator(request.page, pat_index, functions);
|
||||
// !! locale beda w zaleznosci od uzytkownika
|
||||
if( static_cast<size_t>(data.locale.GetLang()) >= patterns.size() )
|
||||
return;
|
||||
|
||||
Ezc::Generator generator(request.page, patterns[data.locale.GetLang()][pat_index], functions);
|
||||
generator.Generate();
|
||||
}
|
||||
|
||||
@@ -582,3 +492,10 @@ using namespace TemplatesFunctions;
|
||||
item_run(info);
|
||||
}
|
||||
|
||||
|
||||
Templates::Templates()
|
||||
{
|
||||
ClearPatterns();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
#include <iomanip>
|
||||
#include <set>
|
||||
|
||||
#include "ezc.h"
|
||||
#include "patterncacher.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
|
||||
@@ -22,11 +22,45 @@ namespace TemplatesFunctions
|
||||
{
|
||||
using Ezc::Info;
|
||||
|
||||
enum Pat {
|
||||
pat_index = 0, // first should be zero
|
||||
pat_fun_cat,
|
||||
pat_fun_ls,
|
||||
pat_fun_emacs,
|
||||
pat_fun_mkdir,
|
||||
pat_fun_default,
|
||||
pat_fun_priv,
|
||||
pat_fun_rm,
|
||||
pat_fun_who,
|
||||
pat_fun_run,
|
||||
pat_fun_last,
|
||||
pat_fun_thread,
|
||||
pat_fun_reload,
|
||||
pat_fun_createthread,
|
||||
pat_fun_upload,
|
||||
pat_fun_ticket,
|
||||
pat_fun_createticket,
|
||||
pat_err_404,
|
||||
pat_err_per_denied,
|
||||
pat_err_others,
|
||||
pat_item_info,
|
||||
pat_item_tab_info,
|
||||
pat_dir_last_info,
|
||||
|
||||
pat_last // should be last
|
||||
};
|
||||
|
||||
struct PatName
|
||||
{
|
||||
int fun_code;
|
||||
Pat pat;
|
||||
};
|
||||
|
||||
|
||||
|
||||
extern TemplatesMisc::Patterns patterns;
|
||||
extern PatternCacher pattern_cacher;
|
||||
extern Ezc::Functions functions;
|
||||
extern Ezc::Pattern pat_item_info;
|
||||
extern Ezc::Pattern pat_item_tab_info;
|
||||
extern Ezc::Pattern pat_dir_last_info;
|
||||
|
||||
|
||||
|
||||
@@ -41,9 +75,7 @@ namespace TemplatesFunctions
|
||||
/*
|
||||
doc
|
||||
*/
|
||||
void doc_language(Info & i);
|
||||
void doc_title(Info & i);
|
||||
void doc_charset(Info & i);
|
||||
void doc_base_url(Info & i);
|
||||
void doc_base_url_static(Info & i);
|
||||
void doc_base_url_static_auth(Info & i);
|
||||
@@ -301,11 +333,18 @@ class Templates
|
||||
{
|
||||
public:
|
||||
|
||||
Templates();
|
||||
|
||||
void ClearPatterns();
|
||||
void ReadTemplates();
|
||||
void CreateFunctions();
|
||||
void Generate();
|
||||
void GenerateRunRaw();
|
||||
|
||||
private:
|
||||
|
||||
std::string temp;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user