forked from mariuz/firebirdwebadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylesheet.php
More file actions
252 lines (196 loc) · 4.71 KB
/
stylesheet.php
File metadata and controls
252 lines (196 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?php
// File stylesheet.php / ibWebAdmin
// Purpose dynamic stylesheet generation
// Author Lutz Brueckner <irie@gmx.de>
// Copyright (c) 2000-2006 by Lutz Brueckner,
// published under the terms of the GNU General Public Licence v.2,
// see file LICENCE for details
// Created <03/09/28 19:25:07 lb>
//
// $Id: stylesheet.php,v 1.17 2006/07/08 17:26:05 lbrueckner Exp $
require('./inc/configuration.inc.php');
require('./inc/functions.inc.php');
session_start();
// don't send the stylesheet if
// a) it's not the first request
// b) $s_stylesheet_etag was not deleted after the customizing form was submitted
// c) stylesheet chaching is not disabled in the configuration
if (isset($_SESSION['s_stylesheet_etag']) && !empty($_SESSION['s_stylesheet_etag']) &&
request_header_check($_SESSION['s_stylesheet_etag']) &&
CACHE_STYLESHEET === TRUE) {
header("HTTP/1.1 304 Not Modified");
send_stylesheet_headers($_SESSION['s_stylesheet_etag']);
}
// send the stylesheet
else {
$_SESSION['s_stylesheet_etag'] = md5(get_stylesheet($_SESSION['s_cust']));
send_stylesheet_headers($_SESSION['s_stylesheet_etag']);
echo get_stylesheet($_SESSION['s_cust']);
}
//
// send http headers to enable caching
//
function send_stylesheet_headers($etag) {
header('Expires: ' . gmdate('D, d M Y H:i:s', (time() + 20000000)) . ' GMT');
header('Cache-Control: public');
header('Pragma: public');
header('Etag: "' . $etag . '"');
header('Content-Type: text/css');
}
//
// return TRUE if the the client is sending an If-None-Match or an If-Modified-Since header
// or if the server isn't ab apache 1.3
//
function request_header_check($etag='') {
if (!function_exists('apache_request_headers')) {
return TRUE;
}
foreach (apache_request_headers() as $header => $value) {
if (strcasecmp($header, 'If-None-Match') == 0 || strcasecmp($header, 'If-Modified-Since') == 0) {
// the header values should be checked ... later
return TRUE;
}
}
return FALSE;
}
//
// return a string with the css definitions
//
function get_stylesheet($customize) {
foreach (get_colornames() as $colorname) {
${'color_'.$colorname} = $customize['color'][$colorname];
}
$fontsize = $customize['fontsize'].'pt';
return <<<EOT
body {
background-color: $color_background;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: $fontsize;
}
td, th, input, select {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: $fontsize;
}
pre {
margin: 0px;
}
textarea {
font-family: Courier,monospace;
font-size: $fontsize;
}
input:focus, textarea:focus {
background-color : $color_selectedinput;
}
input.bgrp {
margin-right: 10px;
}
table {
margin: 2px 0px 2px 0px;
border-collapse: collapse;
}
table.tsep {
margin : 0px;
border-collapse: separate;
}
th {
background-color: $color_headline;
}
a:link, a:active, a:visited {
color: $color_link;
text-decoration: none;
}
a:hover {
color: $color_linkhover;
text-decoration: none;
}
a.dtitle, a.ptitle {
color: black;
font-weight: bold;
white-space: nowrap;
}
a.act {
font-weight: bold;
padding: 0px 5px 0px 5px;
}
.panel {
background-color: $color_panel;
}
.area {
background-color: $color_area;
}
.wttr {
vertical-align: top;
}
.wttr1 {
background-color: $color_firstrow;
}
.wttr2 {
background-color: $color_secondrow;
}
.detail {
padding: 0px 3px 0px 3px;
}
.hex {
font-family: monospace;
font-size: $fontsize;
padding: 0px 5px 0px 5px;
}
.err {
font-weight: bold;
color : red;
}
div.fk {
position: static;
left: 10px;
width: auto;
height: auto;
overflow: auto;
padding: 5px;
}
.selected {
background: $color_selectedrow;
color: HighlightText;
}
td.menu-left {
padding-left: 15px;
border-right: 2px solid $color_menuborder;
border-bottom: 2px solid $color_menuborder;
}
td.menu-right {
padding-left: 15px;
border-bottom: 2px solid $color_menuborder;
width: 100%;
}
td.menu-entry {
border-right: 2px solid $color_menuborder;
border-top: 2px solid $color_menuborder;
padding: 2px 8px 2px 8px;
white-space: nowrap;
}
td.menu-passive {
background: $color_panel;
border-bottom: 2px solid $color_menuborder;
}
a.menu-link {
color: black;
font-weight: bold;
}
iframe {
border: 1px solid $color_iframeborder;
}
div.det {
border-bottom: 1px solid black;
margin: 1px;
}
div.cmt {
margin-left: 28px;
}
div.if {
text-align: center;
}
body.if {
background-color: $color_iframebackground;
}
EOT;
}
?>