added: Patterns class (in templates)
ezc patterns are managed by this class added: some work in groupitem plugin (not finished yet) changed: ConfParser can read a string from memory now (need some testing yet) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@757 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
FunctionBase::FunctionBase()
|
||||
{
|
||||
id = -1;
|
||||
follow_symlinks = true;
|
||||
template_index = size_t(-1);
|
||||
|
||||
fun.user_id = -1;
|
||||
fun.group_id = -1;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -32,11 +32,6 @@ class FunctionBase
|
||||
{
|
||||
public:
|
||||
|
||||
// function id
|
||||
// it is set automatically when you add the function to functions list
|
||||
// is used to load a template (in templates)
|
||||
long id;
|
||||
|
||||
FunctionBase();
|
||||
|
||||
// user, group, permissions, url (function name)
|
||||
@@ -45,6 +40,9 @@ public:
|
||||
// auto follow sym links, default: true
|
||||
bool follow_symlinks;
|
||||
|
||||
// html template index (for using with 'patterns' object)
|
||||
size_t template_index;
|
||||
|
||||
virtual void Init();
|
||||
virtual bool HasAccess();
|
||||
virtual void MakePost();
|
||||
|
@@ -124,6 +124,7 @@ Error Functions::CheckSpecialFile(const Item & item)
|
||||
|
||||
system->mounts.ReadMounts(item.content);
|
||||
templates->ReadNewIndexTemplates();
|
||||
templates->ReadNewChangeTemplates();
|
||||
|
||||
return WINIX_ERR_OK;
|
||||
}
|
||||
@@ -154,7 +155,6 @@ void Functions::Add(FunctionBase * fun)
|
||||
return;
|
||||
}
|
||||
|
||||
fun->id = table.size();
|
||||
SetObjects(fun);
|
||||
table[fun->fun.url] = fun;
|
||||
}
|
||||
|
@@ -271,18 +271,14 @@ void Upload::CreateJSON()
|
||||
{
|
||||
// !! locale beda w zaleznosci od uzytkownika
|
||||
size_t loc = TemplatesFunctions::locale.GetLang();
|
||||
size_t idu = static_cast<size_t>(id);
|
||||
TemplatesFunctions::Patterns & patfun = TemplatesFunctions::patterns_fun;
|
||||
Ezc::Pattern * pat = TemplatesFunctions::patterns.Get(template_index, loc);
|
||||
|
||||
if( loc < patfun.size() && idu < patfun[loc].size() )
|
||||
if( pat )
|
||||
{
|
||||
templates->Generate(patfun[loc][idu]);
|
||||
cur->request->page_generated = true;
|
||||
templates->Generate(*pat);
|
||||
cur->request->page_generated = true;
|
||||
cur->request->use_html_filter = false;
|
||||
}
|
||||
|
||||
// !! usunac
|
||||
//log << log1 << cur->request->page.Str() << logend;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user