mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Moved 'filter menu text' left of 'show only new entries'
SVN revision: 1463
This commit is contained in:
parent
f777223373
commit
e628a19c14
65
src/elogd.c
65
src/elogd.c
@ -6,6 +6,9 @@
|
||||
Contents: Web server program for Electronic Logbook ELOG
|
||||
|
||||
$Log$
|
||||
Revision 1.732 2005/07/29 09:06:33 ritt
|
||||
Moved 'filter menu text' left of 'show only new entries'
|
||||
|
||||
Revision 1.731 2005/07/29 08:37:06 ritt
|
||||
Added 'filter menu text'
|
||||
|
||||
@ -16113,6 +16116,37 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
||||
|
||||
rsprintf("<td class=\"menu2b\">\n");
|
||||
|
||||
/*---- filter menu text ----*/
|
||||
|
||||
if (getcfg(lbs->name, "filter menu text", str, sizeof(str))) {
|
||||
FILE *f;
|
||||
char file_name[256], *buf;
|
||||
|
||||
/* check if file starts with an absolute directory */
|
||||
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||
strcpy(file_name, str);
|
||||
else {
|
||||
strlcpy(file_name, resource_dir, sizeof(file_name));
|
||||
strlcat(file_name, str, sizeof(file_name));
|
||||
}
|
||||
|
||||
f = fopen(file_name, "rb");
|
||||
if (f != NULL) {
|
||||
fseek(f, 0, SEEK_END);
|
||||
size = TELL(fileno(f));
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
buf = xmalloc(size + 1);
|
||||
fread(buf, 1, size, f);
|
||||
buf[size] = 0;
|
||||
fclose(f);
|
||||
|
||||
rsputs(buf);
|
||||
|
||||
} else
|
||||
rsprintf("<center><b>Error: file <i>\"%s\"</i> not found</b></center>", file_name);
|
||||
}
|
||||
|
||||
ref[0] = 0;
|
||||
if (!isparam("new_entries") || atoi(getparam("new_entries")) == 0) {
|
||||
build_ref(ref, sizeof(ref), "", "", "1");
|
||||
@ -16236,37 +16270,6 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
||||
}
|
||||
}
|
||||
|
||||
/*---- filter menu text ----*/
|
||||
|
||||
if (getcfg(lbs->name, "filter menu text", str, sizeof(str))) {
|
||||
FILE *f;
|
||||
char file_name[256], *buf;
|
||||
|
||||
/* check if file starts with an absolute directory */
|
||||
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||
strcpy(file_name, str);
|
||||
else {
|
||||
strlcpy(file_name, resource_dir, sizeof(file_name));
|
||||
strlcat(file_name, str, sizeof(file_name));
|
||||
}
|
||||
|
||||
f = fopen(file_name, "rb");
|
||||
if (f != NULL) {
|
||||
fseek(f, 0, SEEK_END);
|
||||
size = TELL(fileno(f));
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
buf = xmalloc(size + 1);
|
||||
fread(buf, 1, size, f);
|
||||
buf[size] = 0;
|
||||
fclose(f);
|
||||
|
||||
rsputs(buf);
|
||||
|
||||
} else
|
||||
rsprintf("<center><b>Error: file <i>\"%s\"</i> not found</b></center>", file_name);
|
||||
}
|
||||
|
||||
rsprintf(" <b>%d %s</b> ", n_msg, loc("Entries"));
|
||||
|
||||
rsprintf("</td></tr></table></td></tr>\n\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user