Added 'title bgcolor' and 'title fontcolor' in config file

SVN revision: 326
This commit is contained in:
Stefan Ritt 2003-01-09 08:48:14 +00:00
parent 1776474c68
commit 1a86af617a
4 changed files with 47 additions and 13 deletions

View File

@ -11,6 +11,7 @@ Version 2.2.5, released Januar xxth, 2003
- Added "Resource dir" and "Logbook dir"
- Replaced "Data dir" by "Subdir" in elogd.cfg
- Put colors for group and logbook tabs into theme file
- Added "Title bgcolor" and "Title fontcolor" in elogd.cfg
Version 2.2.4, released December 12th, 2002
===========================================

View File

@ -295,6 +295,14 @@ It contains all files for that theme. The format of these files is described und
the <i>Themes</i> section.
<p>
<LI><b><code>Title BGColor = &lt;color&gt;</code></b>
<LI><b><code>Title Fontcolor = &lt;color&gt;</code></b>
<br>
Determines the font and background colors of the title bar. Colors are specified
in the usual HTML format, like <i>white, black,</i> or <i>#808080</i> for hexadecimal
RGB values. See here for <a href="http://www.w3schools.com/html/html_colors.asp">more
examples</a>. The title colors are also used for the currently selected logbook tab.<p>
<LI><b><code>Date format = &lt;string&gt;</code></b>
<br>
This option determines how the date of a logbook entry is displayed. The format

44
elogd.c
View File

@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG
$Log$
Revision 2.127 2003/01/09 08:47:52 midas
Added 'title bgcolor' and 'title fontcolor' in config file
Revision 2.126 2003/01/08 16:01:57 midas
Fixed bug with style sheet
@ -3951,7 +3954,7 @@ int i;
void show_standard_title(char *logbook, char *text, int printable)
{
char str[256], ref[256];
char str[256], ref[256], bgcolor[32], fontcolor[32];
int i, j, n_grp, n_lb, nnum, level;
LBLIST clb, flb, nlb, lbl;
@ -4006,9 +4009,19 @@ LBLIST clb, flb, nlb, lbl;
if (clb[i].member == NULL)
{
if (getcfg(clb[i].name, "Title BGcolor", str))
strlcpy(bgcolor, str, sizeof(bgcolor));
else
strlcpy(bgcolor, gt("LTab1 BGColor"), sizeof(bgcolor));
if (getcfg(clb[i].name, "Title Fontcolor", str))
strlcpy(fontcolor, str, sizeof(fontcolor));
else
strlcpy(fontcolor, gt("LTab1 Fontcolor"), sizeof(fontcolor));
rsprintf("<font size=3 face=verdana,arial,helvetica,sans-serif style=\"color:%s;background-color:%s\">&nbsp;",
gt("LTab1 Fontcolor"), gt("LTab1 BGColor"));
rsprintf("<a style=\"text-decoration:none;color:%s\" href=\"../%s/\">", gt("LTab1 Fontcolor"), ref);
fontcolor, bgcolor);
rsprintf("<a style=\"text-decoration:none;color:%s\" href=\"../%s/\">", fontcolor, ref);
}
else
{
@ -4033,6 +4046,7 @@ LBLIST clb, flb, nlb, lbl;
}
}
strlcpy(str, clb[i].name, sizeof(str));
for (j=0 ; j<(int)strlen(str) ; j++)
if (str[j] == ' ')
@ -4062,26 +4076,36 @@ LBLIST clb, flb, nlb, lbl;
/*---- title row ----*/
if (getcfg(logbook, "Title BGcolor", str))
strlcpy(bgcolor, str, sizeof(bgcolor));
else
strlcpy(bgcolor, gt("Title BGColor"), sizeof(bgcolor));
if (getcfg(logbook, "Title Fontcolor", str))
strlcpy(fontcolor, str, sizeof(fontcolor));
else
strlcpy(fontcolor, gt("Title Fontcolor"), sizeof(fontcolor));
rsprintf("<tr><td><table width=100%% border=0 cellpadding=%s cellspacing=0 bgcolor=#FFFFFF>\n",
gt("Title cellpadding"));
/* left cell */
rsprintf("<tr><td bgcolor=%s align=left>", gt("Title BGColor"));
rsprintf("<tr><td bgcolor=%s align=left>", bgcolor);
/* use comment as title if available, else logbook name */
if (!getcfg(logbook, "Comment", str))
strcpy(str, logbook);
rsprintf("<font size=3 face=verdana,arial,helvetica,sans-serif color=%s><b>&nbsp;&nbsp;%s%s<b></font>\n",
gt("Title fontcolor"), str, text);
fontcolor, str, text);
rsprintf("&nbsp;</td>\n");
/* middle cell */
if (*getparam("full_name"))
{
rsprintf("<td bgcolor=%s align=center>", gt("Title BGColor"));
rsprintf("<td bgcolor=%s align=center>", bgcolor);
rsprintf("<font size=3 face=verdana,arial,helvetica,sans-serif color=%s><b>&nbsp;&nbsp;%s \"%s\"<b></font></td>\n",
gt("Title fontcolor"), loc("Logged in as"), getparam("full_name"));
fontcolor, loc("Logged in as"), getparam("full_name"));
}
else
{
@ -4089,12 +4113,12 @@ LBLIST clb, flb, nlb, lbl;
{
rsprintf("<td bgcolor=%s align=center>", gt("Title BGColor"));
rsprintf("<font size=3 face=verdana,arial,helvetica,sans-serif color=%s><b>&nbsp;&nbsp;%s<b></font></td>\n",
gt("Title fontcolor"), loc("Not logged in"));
fontcolor, loc("Not logged in"));
}
}
/* right cell */
rsprintf("<td bgcolor=%s align=right>", gt("Title BGColor"));
rsprintf("<td bgcolor=%s align=right>", bgcolor);
if (*gt("Title image URL"))
rsprintf("<a href=\"%s\">\n", gt("Title image URL"));
@ -4103,7 +4127,7 @@ LBLIST clb, flb, nlb, lbl;
rsprintf("<img border=0 src=\"%s\">", gt("Title image"));
else
rsprintf("<font size=3 face=verdana,arial,helvetica,sans-serif color=%s><b>ELOG V%s&nbsp;&nbsp</b></font>",
gt("Title fontcolor"), VERSION);
fontcolor, VERSION);
if (*gt("Title image URL"))
rsprintf("</a>\n");

View File

@ -12,14 +12,15 @@ Title image = elog.gif
Title image URL = http://midas.psi.ch/elog
; Colors of logbook selection tabs
; L:Logbook, G:Group, 1:Selected, 2:Others
LTab1 BGColor = #486090
LTab1 Fontcolor = #FFFFFF
LTab2 BGColor = #E0E0E0
LTab2 Fontcolor = #FFFFFF
LTab2 Fontcolor = #606050
GTab1 BGColor = #486090
GTab1 Fontcolor = #FFFFFF
GTab2 BGColor = #FFFFB0
GTab2 Fontcolor = #C0C0C0
GTab2 BGColor = #D0E0C0
GTab2 Fontcolor = #606050
; Look of Menus
Merge menus = 1