diff --git a/plugins/group/templates.cpp b/plugins/group/templates.cpp index 1938c76..98f6a27 100755 --- a/plugins/group/templates.cpp +++ b/plugins/group/templates.cpp @@ -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); }