From 1a86af617a525eb38c9b7301d88ecb4681dd36b5 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 9 Jan 2003 08:48:14 +0000 Subject: [PATCH] Added 'title bgcolor' and 'title fontcolor' in config file SVN revision: 326 --- doc/CHANGELOG.TXT | 1 + doc/config.html | 8 ++++++++ elogd.c | 44 +++++++++++++++++++++++++++++++--------- themes/default/theme.cfg | 7 ++++--- 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/doc/CHANGELOG.TXT b/doc/CHANGELOG.TXT index 852370a7..02be0446 100755 --- a/doc/CHANGELOG.TXT +++ b/doc/CHANGELOG.TXT @@ -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 =========================================== diff --git a/doc/config.html b/doc/config.html index 894eff3f..780c2278 100755 --- a/doc/config.html +++ b/doc/config.html @@ -295,6 +295,14 @@ It contains all files for that theme. The format of these files is described und the Themes section.

+

  • Title BGColor = <color> +
  • Title Fontcolor = <color> +
    +Determines the font and background colors of the title bar. Colors are specified +in the usual HTML format, like white, black, or #808080 for hexadecimal +RGB values. See here for more +examples. The title colors are also used for the currently selected logbook tab.

    +

  • Date format = <string>
    This option determines how the date of a logbook entry is displayed. The format diff --git a/elogd.c b/elogd.c index 224d7601..14cbee8d 100755 --- a/elogd.c +++ b/elogd.c @@ -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(" ", - gt("LTab1 Fontcolor"), gt("LTab1 BGColor")); - rsprintf("", gt("LTab1 Fontcolor"), ref); + fontcolor, bgcolor); + rsprintf("", 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("\n", gt("Title cellpadding")); /* left cell */ - rsprintf("\n"); /* middle cell */ if (*getparam("full_name")) { - rsprintf("\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("\n", - gt("Title fontcolor"), loc("Not logged in")); + fontcolor, loc("Not logged in")); } } /* right cell */ - rsprintf("
    ", gt("Title BGColor")); + rsprintf("
    ", bgcolor); /* use comment as title if available, else logbook name */ if (!getcfg(logbook, "Comment", str)) strcpy(str, logbook); rsprintf("  %s%s\n", - gt("Title fontcolor"), str, text); + fontcolor, str, text); rsprintf(" ", gt("Title BGColor")); + rsprintf("", bgcolor); rsprintf("  %s \"%s\"", gt("Title BGColor")); rsprintf("  %s", gt("Title BGColor")); + rsprintf("", bgcolor); if (*gt("Title image URL")) rsprintf("\n", gt("Title image URL")); @@ -4103,7 +4127,7 @@ LBLIST clb, flb, nlb, lbl; rsprintf("", gt("Title image")); else rsprintf("ELOG V%s  ", - gt("Title fontcolor"), VERSION); + fontcolor, VERSION); if (*gt("Title image URL")) rsprintf("\n"); diff --git a/themes/default/theme.cfg b/themes/default/theme.cfg index 96d3023d..d43b9798 100755 --- a/themes/default/theme.cfg +++ b/themes/default/theme.cfg @@ -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