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:
@@ -9,16 +9,65 @@
|
||||
|
||||
#include "templates/templates.h"
|
||||
#include "core/plugin.h"
|
||||
#include "groupinfo.h"
|
||||
|
||||
|
||||
namespace Groupitem
|
||||
namespace GroupItem
|
||||
{
|
||||
using namespace TemplatesFunctions;
|
||||
using TemplatesFunctions::system;
|
||||
|
||||
|
||||
extern GroupInfo group_info;
|
||||
|
||||
|
||||
static size_t group_tab_reqid = 0;
|
||||
static bool group_tab_found = false;
|
||||
static Groups * pgroups;
|
||||
static size_t group_index;
|
||||
static size_t group_tab_index;
|
||||
static std::wstring group_last_path;
|
||||
|
||||
|
||||
|
||||
|
||||
void group_tab_init(const std::wstring & path)
|
||||
{
|
||||
if( group_tab_reqid != cur->request->id || group_last_path != path)
|
||||
{
|
||||
group_tab_found = false;
|
||||
group_tab_reqid = cur->request->id;
|
||||
group_last_path = path;
|
||||
pgroups = group_info.FindGroups(cur->request->dir_tab.back()->id);
|
||||
|
||||
if( pgroups )
|
||||
{
|
||||
group_tab_found = true;
|
||||
group_index = pgroups->Find(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void group_tab(Info & i)
|
||||
{
|
||||
group_tab_init(i.par);
|
||||
group_tab_index = i.iter;
|
||||
|
||||
if( group_tab_found )
|
||||
i.res = group_tab_index < pgroups->GroupSize(group_index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void group_tab_link(Info & i)
|
||||
{
|
||||
if( group_tab_found )
|
||||
i.out << pgroups->GroupPath(group_index, group_tab_index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AddEzcFunctions(PluginInfo & info)
|
||||
@@ -26,7 +75,8 @@ void AddEzcFunctions(PluginInfo & info)
|
||||
using TemplatesFunctions::EzcFun;
|
||||
EzcFun * fun = reinterpret_cast<EzcFun*>(info.p1);
|
||||
|
||||
// fun->Insert("gallery_tab", gallery_tab);
|
||||
fun->Insert("group_tab", group_tab);
|
||||
fun->Insert("group_tab_link", group_tab_link);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user