<?php
/*
 * $Horde: chora/css.php,v 1.3 2001/02/27 07:05:59 avsm Exp $
 *
 * Copyright 2000,2001 Charles J. Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file COPYING for license information (LGPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

require dirname(__FILE__).'/config/html.php';
    
if ($conf['css']['cached']) {
    $mod_gmt = gmdate('D, d M Y H:i:s', getlastmod()) . ' GMT';
    header('Last-Modified: ' . $mod_gmt);
    header('Cache-Control: public, max-age=86400');
} else {
    header('Expires: -1');
    header('Pragma: no-cache');
    header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
}

header('Content-type: text/css');

if (is_array($css)) {
    foreach ($css as $class => $params) {
        echo "$class {\n";
        if (is_array($params)) {
            foreach ($params as $key => $val) {
                echo "\t$key: $val;\n";
            }
        }
        echo "}\n\n";
    }
}

?>
