]> git.ipfire.org Git - thirdparty/sarg.git/blame - css.c
Imported sarg 2.0.9
[thirdparty/sarg.git] / css.c
CommitLineData
25697a35 1/*
94ff9470 2 * AUTHOR: Pedro Lineu Orso orso@penguintech.com.br
25697a35 3 * 1998, 2005
94ff9470 4 * SARG Squid Analysis Report Generator http://sarg.sourceforge.net
25697a35
GS
5 *
6 * SARG donations:
7 * please look at http://sarg.sourceforge.net/donations.php
8 * ---------------------------------------------------------------------
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
23 *
24 */
25
26#include "include/conf.h"
27
28int css(FILE *fp_css)
29{
30 FILE *fp_in, *fp_ou;
31 char csstext[512];
32
33 fp_ou = fp_css;
34 if(strlen(ExternalCSSFile) > 0) {
35 if((fp_in=fopen(ExternalCSSFile,"r"))==NULL) {
36 fprintf(stderr, "SARG: (css) %s: %s\n",text[45],ExternalCSSFile);
37 exit(1);
38 }
39 fputs("<style>\n",fp_ou);
40 while(fgets(buf,MAXLEN,fp_in)!=NULL)
41 fputs(buf,fp_ou);
42 fputs("</style>\n",fp_ou);
43 return;
44 }
45
46 fputs("<style>\n",fp_ou);
94ff9470
GS
47
48 sprintf(csstext,".logo {font-family:Verdana,Tahoma,Arial;font-size:11px;color:%s;}\n",LogoTextColor);
49 fputs(csstext,fp_ou);
25697a35
GS
50 sprintf(csstext,".body {font-family:%s;color:%s;background-color:%s;}\n", \
51 FontFace, TxColor, BgColor);
52 fputs(csstext,fp_ou);
53
54
55 sprintf(csstext,".info {font-family:%s;font-size:9px;}\n", FontFace);
56 fputs(csstext,fp_ou);
57 sprintf(csstext,".info a:link,a:visited {font-family:%s;color:#0000FF;font-size:9px;text-decoration:none;}\n", FontFace);
58 fputs(csstext,fp_ou);
59
60 sprintf(csstext,".title {font-family:%s;font-size:%s;color:%s;background-color:%s;}\n", \
61 FontFace, TitleFontSize, TiColor, BgColor);
62 fputs(csstext,fp_ou);
63
64 sprintf(csstext,".header {font-family:%s;font-size:%s;color:%s;background-color:%s; \
65 text-align:left;border-right:1px solid #6A5ACD;border-bottom:1px solid #6A5ACD;}\n", \
66 FontFace, HeaderFontSize, HeaderColor, HeaderBgColor);
67 fputs(csstext,fp_ou);
68
69 sprintf(csstext,".header2 {font-family:%s;font-size:%s;color:%s;background-color:%s; \
70 text-align:right;border-right:1px solid #6A5ACD;border-bottom:1px solid #6A5ACD;}\n", \
71 FontFace, HeaderFontSize, HeaderColor, HeaderBgColor);
72 fputs(csstext,fp_ou);
73
74 sprintf(csstext,".header3 {font-family:%s;font-size:%s;color:%s;background-color:%s;text-align:center;border-right:1px solid #6A5ACD;border-bottom:1px solid #6A5ACD;}\n", \
75 FontFace, HeaderFontSize, HeaderColor, HeaderBgColor);
76 fputs(csstext,fp_ou);
77
78 sprintf(csstext,".text {font-family:%s;color:%s;font-size:%s;}\n", FontFace, TxColor, FontSize);
79 fputs(csstext,fp_ou);
80
81 sprintf(csstext,".data {font-family:%s;color:%s;font-size:%s;background-color:%s;text-align:right;border-right:1px solid #6A5ACD;border-bottom:1px solid #6A5ACD;}\n", FontFace, TxColor, FontSize, TxBgColor);
82 fputs(csstext,fp_ou);
83 sprintf(csstext,".data a:link,a:visited {font-family:%s;color:#0000FF;font-size:%s;background-color:%s;text-align:right;text-decoration:none;}\n", FontFace, FontSize, TxBgColor);
84 fputs(csstext,fp_ou);
85
86 sprintf(csstext,".data2 {font-family:%s;color:%s;font-size:%s;background-color:%s;border-right:1px solid #6A5ACD;border-bottom:1px solid #6A5ACD;}\n", FontFace, TxColor, FontSize, TxBgColor);
87 fputs(csstext,fp_ou);
88 sprintf(csstext,".data2 a:link,a:visited {font-family:%s;color:#0000FF;font-size:%s;background-color:%s;text-decoration:none;}\n", FontFace, FontSize, TxBgColor);
89 fputs(csstext,fp_ou);
90
91 sprintf(csstext,".link {font-family:%s;font-size:%s;color:#0000FF;}\n", FontFace, FontSize);
92 fputs(csstext,fp_ou);
93 sprintf(csstext,".link a:link,a:visited {font-family:%s;font-size:%s;color:#0000FF;text-decoration:none;}\n", FontFace, FontSize);
94 fputs(csstext,fp_ou);
95
96 fputs("</style>\n",fp_ou);
97 fflush(fp_ou);
98
99 return;
100;}