3 * @name tsControllerCss
4 * @package CSS output class
7 class tsControllerCss
extends tsController
{
10 private $media = 'screen';
13 * the constructor that does it all.
14 * starts output buffering, and initializes different things
17 public function __construct(){
20 $this->theme
= (!empty($_COOKIE['theme']) ?
$_COOKIE['theme'] : DEFAULT_THEME
);
22 $this->media
= tsController
::getRequest('do');
24 if (empty($this->media
))
25 $this->media
= 'screen';
27 if (!is_file(THEME_PATH
. $this->theme
. DIRECTORY_SEPARATOR
.'_css'. DIRECTORY_SEPARATOR
.$this->media
.'.css')) {
28 $this->theme
= DEFAULT_THEME
;
29 $this->media
= 'screen';
34 public function dispatch (){
36 header('Content-type: text/css');
37 $out = file_get_contents ( THEME_PATH
. $this->theme
. DIRECTORY_SEPARATOR
.'_css'. DIRECTORY_SEPARATOR
.$this->media
.'.css');
38 $this->postDispatch ( $out );
42 private function postDispatch ($incString){
44 header ('Expires: '.strftime ('%a, %d %m %Y %T GMT', time()+
2419200)); // one month
45 if (stristr ($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
46 $incString = str_replace(array('min-width:', 'max-width:'), 'width:', $incString);
50 array ('%TIME%','%QUERIES%', '%MEMUSED%'),
52 number_format(microtime (true) - $GLOBALS['st'] , 5, ',', '.'),
54 number_format(memory_get_usage()/1024, 3, ',', '.')