Added 'menu text' and 'find menu text'
SVN revision: 289
This commit is contained in:
@@ -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
|
||||
===========================================
|
||||
|
||||
|
||||
@@ -381,6 +381,33 @@ Guest menu commands = Back, Find, Login, Help
|
||||
</br>
|
||||
Same as <b>Guest Menu commands</b> but for the find result page.<p>
|
||||
|
||||
<li><b><code>Menu text = <file></code></b>
|
||||
</br>
|
||||
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 <i>Routine</i> entry and all <i>Routine</i> entries:<br>
|
||||
|
||||
<pre>
|
||||
<small>
|
||||
&nbsp;<a href="?cmd=next&type=Routine">Next Routine entry</a>&nbsp;|
|
||||
&nbsp;<a href="../?Type=Routine">All Routine entries</a>
|
||||
</small>
|
||||
</pre>
|
||||
|
||||
<li><b><code>Find Menu text = <file></code></b>
|
||||
</br>
|
||||
The same for the find result page. One example would be following text to
|
||||
switch between the different display modi:<br>
|
||||
|
||||
<pre>
|
||||
<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>
|
||||
</pre>
|
||||
|
||||
<li><b><code>Bottom text = <file></code></b>
|
||||
</br>
|
||||
If this option is present, the HTML contents of <b><code>file</code></b> is displayed at
|
||||
|
||||
@@ -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("<tr><td><table width=100%% border=0 cellpadding=%s cellspacing=1 bgcolor=%s>\n",
|
||||
gt("Menu1 cellpadding"), gt("Frame color"));
|
||||
|
||||
rsprintf("<tr><td align=%s bgcolor=%s>\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("<center><b>Error: file <i>\"%s\"</i> not found</b></center>", file_name);
|
||||
|
||||
rsprintf("</td></tr></table></td></tr>");
|
||||
}
|
||||
|
||||
/*---- display filters ----*/
|
||||
|
||||
rsprintf("<tr><td><table width=100%% border=%s cellpadding=%s cellspacing=1>\n",
|
||||
@@ -8756,6 +8802,49 @@ BOOL first;
|
||||
|
||||
rsprintf("</table></td></tr>\n\n");
|
||||
|
||||
/*---- menu text ----*/
|
||||
|
||||
if (getcfg(lbs->name, "menu text", str))
|
||||
{
|
||||
FILE *f;
|
||||
char file_name[256], *buf;
|
||||
|
||||
rsprintf("<tr><td><table width=100%% border=0 cellpadding=%s cellspacing=1 bgcolor=%s>\n",
|
||||
gt("Menu1 cellpadding"), gt("Frame color"));
|
||||
|
||||
rsprintf("<tr><td align=%s bgcolor=%s>\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("<center><b>Error: file <i>\"%s\"</i> not found</b></center>", file_name);
|
||||
|
||||
rsprintf("</td></tr></table></td></tr>");
|
||||
}
|
||||
|
||||
/*---- message ----*/
|
||||
|
||||
/* overall table for message giving blue frame */
|
||||
|
||||
Reference in New Issue
Block a user