Changeset 1019 for devel/_templates
- Timestamp:
- 03/10/07 19:43:27 (2 years ago)
- Files:
-
- devel/_templates/css.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/_templates/css.php
r296 r1019 5 5 header("Content-type: text/css; charset=utf-8"); 6 6 7 $template_id = optional_param('template' ,0,PARAM_INT);7 $template_id = optional_param('template'); 8 8 9 echo templates_draw(array( 9 // templates_draw() uses the global $template_name, not the 'template' array param, to choose a template 10 $template_name = $template_id; 11 12 $css = templates_draw(array( 10 13 'template' => $template_id, 11 14 'context' => 'css' 12 15 ) 13 16 ); 14 17 18 $etag = md5($css); 19 20 header('Cache-Control: public'); 21 header('Pragma: '); 22 23 //header('Expires: '. gmdate('D, d M Y H:i:s', 0) .'GMT'); 24 header('ETag: ' . $etag . ''); 25 26 // Send 304s where possible, rather than spitting out the file each time 27 if (array_key_exists('HTTP_IF_NONE_MATCH',$_SERVER)) { 28 $if_none_match = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 29 if ($if_none_match == $etag) { 30 header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); 31 exit; 32 } 33 } 34 35 echo $css; 36 15 37 ?>
