From 71c55a715e7045670e5666d0281b54d09ee20523 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 28 Oct 2005 21:36:23 +0000 Subject: [PATCH] Implemented absolute redirection via URL statement in logbook selection page SVN revision: 1540 --- src/elogd.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 62b3808b..7c82827b 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -20495,6 +20495,8 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop) /* do not display top groups */ if (!plb->is_top) { + compose_base_url(NULL, ref, sizeof(ref)); + rsprintf(""); for (i = 0; i < level; i++) rsprintf(" \n"); @@ -20502,22 +20504,31 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop) for (i = 0; i < level; i++) rsprintf("  "); if (expand) { - if (pparent == NULL) - sprintf(ref, "."); - else - sprintf(ref, "?gexp=%s", pparent->name); if (expand_all) - rsprintf("%s", plb->name); - else - rsprintf("- %s ", ref, plb->name); + rsprintf(plb->name); + else { + if (pparent != NULL) { + if (getcfg_topgroup()) + rsprintf("- %s ", ref, getcfg_topgroup(), pparent->name, plb->name); + else + rsprintf("- %s ", ref, pparent->name, plb->name); + } else { + if (getcfg_topgroup()) + rsprintf("- %s ", ref, getcfg_topgroup(), plb->name); + else + rsprintf("- %s ", ref, plb->name); + } + } } else { - sprintf(ref, "?gexp=%s", plb->name); - if (expand_all) - rsprintf("%s", plb->name); - else - rsprintf("+ %s ", ref, plb->name); + rsprintf(plb->name); + else { + if (getcfg_topgroup()) + rsprintf("+ %s ", ref, getcfg_topgroup(), plb->name, plb->name); + else + rsprintf("+ %s ", ref, plb->name, plb->name); + } } rsprintf("\n"); @@ -20536,15 +20547,18 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop) break; if (!lb_list[index].name[0]) return; + rsprintf(""); for (j = 0; j < level; j++) rsprintf(" \n"); rsprintf("", 10 - level); - /* add one ".." if we are under top group */ - if (btop) - rsprintf("%s", lb_list[index].name_enc, lb_list[index].name); - else - rsprintf("%s", lb_list[index].name_enc, lb_list[index].name); + + compose_base_url(&lb_list[index], ref, sizeof(ref)); +// if (btop) +// rsprintf("%s", lb_list[index].name_enc, lb_list[index].name); + + rsprintf("%s", ref, lb_list[index].name); + if (getcfg(lb_list[index].name, "Read password", str, sizeof(str)) || (getcfg(lb_list[index].name, "Password file", str, sizeof(str)) && !getcfg(lb_list[index].name, "Guest menu commands", str, sizeof(str)))) @@ -21362,7 +21376,8 @@ void interprete(char *lbook, char *path) /* deliver icons without password */ if (chkext(path, ".gif") || chkext(path, ".jpg") || - chkext(path, ".png") || chkext(path, ".ico") || chkext(path, ".htm") || chkext(path, ".css")) { + chkext(path, ".png") || chkext(path, ".ico") || + chkext(path, ".htm") || chkext(path, ".css")) { /* check if file in resource directory */ strlcpy(str, resource_dir, sizeof(str)); strlcat(str, path, sizeof(str));