Added 'menu text' and 'find menu text'

SVN revision: 289
This commit is contained in:
2002-11-21 09:13:33 +00:00
parent 7c81308e0a
commit 3159635a90
3 changed files with 121 additions and 0 deletions
+5
View File
@@ -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
===========================================
+27
View File
@@ -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 = &lt;file&gt;</code></b>
</br>
If this option is present, and additional menu row above the message gets displayed with
the contents of &lt;file&gt;. 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>
&lt;small&gt;
&amp;nbsp;&lt;a href="?cmd=next&type=Routine"&gt;Next Routine entry&lt;/a&gt;&amp;nbsp;|
&amp;nbsp;&lt;a href="../?Type=Routine"&gt;All Routine entries&lt;/a&gt;
&lt;/small&gt;
</pre>
<li><b><code>Find Menu text = &lt;file&gt;</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>
&lt;small&gt;
&amp;nbsp;&lt;a href="?mode=summary"&gt;Summary&lt;/a&gt;&amp;nbsp;|
&amp;nbsp;&lt;a href="?mode=full"&gt;Full&lt;/a&gt;&amp;nbsp;|
&amp;nbsp;&lt;a href="?mode=threaded"&gt;Threaded&lt;/a&gt;&amp;nbsp;|
&lt;/small&gt;
</pre>
<li><b><code>Bottom text = &lt;file&gt;</code></b>
</br>
If this option is present, the HTML contents of <b><code>file</code></b> is displayed at
+89
View File
@@ -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 */