mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-27 02:57:22 +00:00
Implemented absolute redirection via URL statement in logbook selection page
SVN revision: 1540
This commit is contained in:
parent
858a5153e9
commit
71c55a715e
51
src/elogd.c
51
src/elogd.c
@ -20495,6 +20495,8 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
|
|||||||
/* do not display top groups */
|
/* do not display top groups */
|
||||||
if (!plb->is_top) {
|
if (!plb->is_top) {
|
||||||
|
|
||||||
|
compose_base_url(NULL, ref, sizeof(ref));
|
||||||
|
|
||||||
rsprintf("<tr>");
|
rsprintf("<tr>");
|
||||||
for (i = 0; i < level; i++)
|
for (i = 0; i < level; i++)
|
||||||
rsprintf("<td class=\"selspace\"> </td>\n");
|
rsprintf("<td class=\"selspace\"> </td>\n");
|
||||||
@ -20502,22 +20504,31 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
|
|||||||
for (i = 0; i < level; i++)
|
for (i = 0; i < level; i++)
|
||||||
rsprintf(" ");
|
rsprintf(" ");
|
||||||
if (expand) {
|
if (expand) {
|
||||||
if (pparent == NULL)
|
|
||||||
sprintf(ref, ".");
|
|
||||||
else
|
|
||||||
sprintf(ref, "?gexp=%s", pparent->name);
|
|
||||||
|
|
||||||
if (expand_all)
|
if (expand_all)
|
||||||
rsprintf("%s", plb->name);
|
rsprintf(plb->name);
|
||||||
else
|
else {
|
||||||
rsprintf("<a href=\"%s\">- %s</a> ", ref, plb->name);
|
if (pparent != NULL) {
|
||||||
|
if (getcfg_topgroup())
|
||||||
|
rsprintf("<a href=\"%s%s/?gexp=%s\">- %s</a> ", ref, getcfg_topgroup(), pparent->name, plb->name);
|
||||||
|
else
|
||||||
|
rsprintf("<a href=\"%s?gexp=%s\">- %s</a> ", ref, pparent->name, plb->name);
|
||||||
|
} else {
|
||||||
|
if (getcfg_topgroup())
|
||||||
|
rsprintf("<a href=\"%s%s/\">- %s</a> ", ref, getcfg_topgroup(), plb->name);
|
||||||
|
else
|
||||||
|
rsprintf("<a href=\"%s\">- %s</a> ", ref, plb->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(ref, "?gexp=%s", plb->name);
|
|
||||||
|
|
||||||
if (expand_all)
|
if (expand_all)
|
||||||
rsprintf("%s", plb->name);
|
rsprintf(plb->name);
|
||||||
else
|
else {
|
||||||
rsprintf("<a href=\"%s\">+ %s</a> ", ref, plb->name);
|
if (getcfg_topgroup())
|
||||||
|
rsprintf("<a href=\"%s%s/?gexp=%s\">+ %s</a> ", ref, getcfg_topgroup(), plb->name, plb->name);
|
||||||
|
else
|
||||||
|
rsprintf("<a href=\"%s?gexp=%s\">+ %s</a> ", ref, plb->name, plb->name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rsprintf("</td></tr>\n");
|
rsprintf("</td></tr>\n");
|
||||||
@ -20536,15 +20547,18 @@ void show_logbook_node(LBLIST plb, LBLIST pparent, int level, int btop)
|
|||||||
break;
|
break;
|
||||||
if (!lb_list[index].name[0])
|
if (!lb_list[index].name[0])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rsprintf("<tr>");
|
rsprintf("<tr>");
|
||||||
for (j = 0; j < level; j++)
|
for (j = 0; j < level; j++)
|
||||||
rsprintf("<td class=\"selspace\"> </td>\n");
|
rsprintf("<td class=\"selspace\"> </td>\n");
|
||||||
rsprintf("<td colspan=%d class=\"sellogbook\">", 10 - level);
|
rsprintf("<td colspan=%d class=\"sellogbook\">", 10 - level);
|
||||||
/* add one ".." if we are under top group */
|
|
||||||
if (btop)
|
compose_base_url(&lb_list[index], ref, sizeof(ref));
|
||||||
rsprintf("<a href=\"../%s/\">%s</a>", lb_list[index].name_enc, lb_list[index].name);
|
// if (btop)
|
||||||
else
|
// rsprintf("<a href=\"../%s/\">%s</a>", lb_list[index].name_enc, lb_list[index].name);
|
||||||
rsprintf("<a href=\"%s/\">%s</a>", lb_list[index].name_enc, lb_list[index].name);
|
|
||||||
|
rsprintf("<a href=\"%s\">%s</a>", ref, lb_list[index].name);
|
||||||
|
|
||||||
if (getcfg(lb_list[index].name, "Read password", str, sizeof(str))
|
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, "Password file", str, sizeof(str))
|
||||||
&& !getcfg(lb_list[index].name, "Guest menu commands", 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 */
|
/* deliver icons without password */
|
||||||
if (chkext(path, ".gif") || chkext(path, ".jpg") ||
|
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 */
|
/* check if file in resource directory */
|
||||||
strlcpy(str, resource_dir, sizeof(str));
|
strlcpy(str, resource_dir, sizeof(str));
|
||||||
strlcat(str, path, sizeof(str));
|
strlcat(str, path, sizeof(str));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user