diff --git a/doc/CHANGELOG.TXT b/doc/CHANGELOG.TXT index cbcaf96c..14ed7410 100755 --- a/doc/CHANGELOG.TXT +++ b/doc/CHANGELOG.TXT @@ -1,3 +1,8 @@ +Version 2.2.4, released Nobember xxth, 2002 +=========================================== + +- Added option "Menu text = xxxx" and "Find Menu text = xxxx" + Version 2.2.3, released Nobember 20th, 2002 =========================================== diff --git a/doc/config.html b/doc/config.html index b9e64628..303a2dc1 100755 --- a/doc/config.html +++ b/doc/config.html @@ -381,6 +381,33 @@ Guest menu commands = Back, Find, Login, Help
Same as Guest Menu commands but for the find result page.

+

  • Menu text = <file> +
    +If this option is present, and additional menu row above the message gets displayed with +the contents of <file>. This file can contain arbitrary text, images or links. +One example would be following text to go back to the listing page and display the +next Routine entry and all Routine entries:
    + +
    +<small>
    +&nbsp;<a href="?cmd=next&type=Routine">Next Routine entry</a>&nbsp;|
    +&nbsp;<a href="../?Type=Routine">All Routine entries</a>
    +</small>
    +
    + +
  • Find Menu text = <file> +
    +The same for the find result page. One example would be following text to +switch between the different display modi:
    + +
    +<small>
    +&nbsp;<a href="?mode=summary">Summary</a>&nbsp;|
    +&nbsp;<a href="?mode=full">Full</a>&nbsp;|
    +&nbsp;<a href="?mode=threaded">Threaded</a>&nbsp;|
    +</small>
    +
    +
  • Bottom text = <file>
    If this option is present, the HTML contents of file is displayed at diff --git a/elogd.c b/elogd.c index 6a10894f..bb51b70b 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 2.101 2002/11/21 09:13:33 midas + Added 'menu text' and 'find menu text' + Revision 2.100 2002/11/20 14:20:16 midas Fixed bug with bottom text file display @@ -7444,6 +7447,49 @@ char slist[MAX_N_ATTR+10][NAME_LENGTH], svalue[MAX_N_ATTR+10][NAME_LENGTH]; } + /*---- find menu text ----*/ + + if (getcfg(lbs->name, "find menu text", str) && !printable) + { + FILE *f; + char file_name[256], *buf; + + rsprintf("\n", + gt("Menu1 cellpadding"), gt("Frame color")); + + rsprintf("
    \n", gt("Menu1 Align"), gt("Menu1 BGColor")); + + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } + + f = fopen(file_name, "rb"); + if (f != NULL) + { + fseek(f, 0, SEEK_END); + size = TELL(fileno(f)); + fseek(f, 0, SEEK_SET); + + buf = malloc(size+1); + fread(buf, 1, size, f); + buf[size] = 0; + fclose(f); + + + rsputs(buf); + + } + else + rsprintf("
    Error: file \"%s\" not found
    ", file_name); + + rsprintf("
    "); + } + /*---- display filters ----*/ rsprintf("\n", @@ -8756,6 +8802,49 @@ BOOL first; rsprintf("
    \n\n"); + /*---- menu text ----*/ + + if (getcfg(lbs->name, "menu text", str)) + { + FILE *f; + char file_name[256], *buf; + + rsprintf("\n", + gt("Menu1 cellpadding"), gt("Frame color")); + + rsprintf("
    \n", gt("Menu1 Align"), gt("Menu1 BGColor")); + + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else + { + strcpy(file_name, cfg_dir); + strcat(file_name, str); + } + + f = fopen(file_name, "rb"); + if (f != NULL) + { + fseek(f, 0, SEEK_END); + size = TELL(fileno(f)); + fseek(f, 0, SEEK_SET); + + buf = malloc(size+1); + fread(buf, 1, size, f); + buf[size] = 0; + fclose(f); + + + rsputs(buf); + + } + else + rsprintf("
    Error: file \"%s\" not found
    ", file_name); + + rsprintf("
    "); + } + /*---- message ----*/ /* overall table for message giving blue frame */