MDL-11515:
[moodle-linuxchix.git] / mod / data / css.php
blob00469ed2ed45092576c5fc01bb63d68807846f8f
1 <?php // $Id$
2 ///////////////////////////////////////////////////////////////////////////
3 // //
4 // NOTICE OF COPYRIGHT //
5 // //
6 // Moodle - Modular Object-Oriented Dynamic Learning Environment //
7 // http://moodle.org //
8 // //
9 // Copyright (C) 2005 Martin Dougiamas http://dougiamas.com //
10 // //
11 // This program is free software; you can redistribute it and/or modify //
12 // it under the terms of the GNU General Public License as published by //
13 // the Free Software Foundation; either version 2 of the License, or //
14 // (at your option) any later version. //
15 // //
16 // This program is distributed in the hope that it will be useful, //
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
19 // GNU General Public License for more details: //
20 // //
21 // http://www.gnu.org/copyleft/gpl.html //
22 // //
23 ///////////////////////////////////////////////////////////////////////////
25 $lifetime = 600; // Seconds to cache this stylesheet
26 $nomoodlecookie = true; // Cookies prevent caching, so don't use them
28 require_once('../../config.php');
30 $d = optional_param('d', 0, PARAM_INT); // database id
32 if ($data = get_record('data', 'id', $d)) {
33 header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
34 header('Expires: ' . gmdate("D, d M Y H:i:s", time() + $lifetime) . ' GMT');
35 header('Cache-control: max_age = '. $lifetime);
36 header('Pragma: ');
37 header('Content-type: text/css'); // Correct MIME type
39 echo $data->csstemplate;