diff --git a/html/fun_ls.html b/html/fun_ls.html
index d8ec734..a297b65 100755
--- a/html/fun_ls.html
+++ b/html/fun_ls.html
@@ -6,7 +6,7 @@
[if dir_childs_tab "with_parent"]
-
+
[for dir_childs_tab "with_parent"]
diff --git a/html/index_header.html b/html/index_header.html
index 6f583cf..4cfcdf0 100755
--- a/html/index_header.html
+++ b/html/index_header.html
@@ -20,7 +20,7 @@
[if-one dir_tab]
[for dir_tab]
- - [dir_tab_url] /
+ - [dir_tab_url] /
[end]
[if-one item_is]
diff --git a/templates/dir.cpp b/templates/dir.cpp
index 48e2f31..cd03250 100755
--- a/templates/dir.cpp
+++ b/templates/dir.cpp
@@ -294,21 +294,29 @@ void dir_tab_url(Info & i)
void dir_tab_link(Info & i)
{
- doc_proto(i);
-
- if( !cur->request->subdomain.empty() )
- i.out << cur->request->subdomain << '.';
-
- i.out << config->base_url;
-
for(size_t a = 0 ; a <= dir_index && a < cur->request->dir_tab.size() ; ++a)
{
- i.out << cur->request->dir_tab[a]->url;
+ // index zero is a root directory
+ if( a != 0 )
+ i.out << cur->request->dir_tab[a]->url;
+
i.out << '/';
}
}
+void dir_tab_is_root(Info & i)
+{
+ i.res = (dir_index == 0);
+}
+
+
+void dir_tab_subject(Info & i)
+{
+ if( dir_index < cur->request->dir_tab.size() )
+ i.out << cur->request->dir_tab[dir_index]->subject;
+}
+
void dir_last_link_to(Info & i)
{
diff --git a/templates/templates.cpp b/templates/templates.cpp
index 9d84b51..f511938 100755
--- a/templates/templates.cpp
+++ b/templates/templates.cpp
@@ -205,6 +205,8 @@ void Templates::CreateFunctions()
ezc_functions.Insert("dir_tab", dir_tab);
ezc_functions.Insert("dir_tab_url", dir_tab_url);
ezc_functions.Insert("dir_tab_link", dir_tab_link);
+ ezc_functions.Insert("dir_tab_subject", dir_tab_subject);
+ ezc_functions.Insert("dir_tab_is_root", dir_tab_is_root);
ezc_functions.Insert("dir_last_link_to", dir_last_link_to);
ezc_functions.Insert("dir_last_is_link_redirect", dir_last_is_link_redirect);
diff --git a/templates/templates.h b/templates/templates.h
index 86e639f..4225282 100755
--- a/templates/templates.h
+++ b/templates/templates.h
@@ -115,6 +115,8 @@ namespace TemplatesFunctions
void dir_tab(Info & i);
void dir_tab_url(Info & i);
void dir_tab_link(Info & i);
+ void dir_tab_subject(Info & i);
+ void dir_tab_is_root(Info & i);
void dir_last_link_to(Info &);
void dir_last_is_link_redirect(Info & i);