forked from fufroma/smartsieve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
css.php
36 lines (31 loc) · 931 Bytes
/
css.php
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
<?php
/*
* $Id$
*
* Copyright (C) 2002-2007 Stephen Grier <[email protected]>
*
* See the inclosed NOTICE file for conditions of use and distribution.
*/
include './lib/SmartSieve.lib';
require SmartSieve::getConf('config_dir', 'conf') . '/style.php';
header('Content-type: text/css');
if (SmartSieve::getConf('cache_css') !== false) {
$mtime = filemtime(SmartSieve::getConf('config_dir', 'conf') . '/style.php');
$last_mod = sprintf('%s GMT', gmdate('D, d M Y H:i:s', $mtime));
header('Last-Modified: ' . $last_mod);
header('Cache-Control: max-age=86400, public, must-revalidate');
} else {
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Expires: -1');
}
if (is_array($css)){
foreach ($css as $class => $attributes){
echo $class . "{\n";
if (is_array($attributes)){
foreach ($attributes as $name => $val){
echo "\t$name: $val;\n";
}
}
echo "}\n\n";
}
}