added: to 'group' plugin: new ezc function: group_tab_is_current_link
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@774 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
0550212b64
commit
1e9ab2f805
|
@ -70,17 +70,29 @@ void group_tab(Info & i)
|
|||
}
|
||||
|
||||
|
||||
|
||||
void build_current_path()
|
||||
{
|
||||
system->dirs.MakePath(cur->request->dir_tab, path);
|
||||
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
path += cur->request->item.url;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we assume that directories are without the last trailing slash
|
||||
NoLastSlash(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void group_link_tab(Info & i)
|
||||
{
|
||||
if( i.params.size() == 1 )
|
||||
{
|
||||
system->dirs.MakePath(cur->request->dir_tab, path);
|
||||
|
||||
if( cur->request->is_item )
|
||||
path += cur->request->item.url;
|
||||
else
|
||||
NoLastSlash(path);
|
||||
|
||||
build_current_path();
|
||||
group_tab_init(i.params[0], path);
|
||||
value_index = i.iter;
|
||||
|
||||
|
@ -107,6 +119,21 @@ void group_tab_value(Info & i)
|
|||
}
|
||||
|
||||
|
||||
void group_tab_is_current_link(Info & i)
|
||||
{
|
||||
if( group_tab_found )
|
||||
{
|
||||
build_current_path();
|
||||
|
||||
if( !i.par.empty() )
|
||||
i.res = (pgroups->GetOption(set_index, group_index, value_index, i.par) == path);
|
||||
else
|
||||
i.res = (pgroups->GetOption(set_index, group_index, value_index, L"value") == path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AddEzcFunctions(PluginInfo & info)
|
||||
{
|
||||
|
@ -115,9 +142,10 @@ void AddEzcFunctions(PluginInfo & info)
|
|||
|
||||
/*
|
||||
*/
|
||||
fun->Insert("group_tab", group_tab);
|
||||
fun->Insert("group_link_tab", group_link_tab);
|
||||
fun->Insert("group_tab_value", group_tab_value);
|
||||
fun->Insert("group_tab", group_tab);
|
||||
fun->Insert("group_link_tab", group_link_tab);
|
||||
fun->Insert("group_tab_value", group_tab_value);
|
||||
fun->Insert("group_tab_is_current_link", group_tab_is_current_link);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue