* making the css and rss controllers work for real :D
[vsc.git] / _res / _libs / tscontrollercss.class.php
blobf8a3bc4b76f84036d0def61aff1450cce8446577
1 <?php
2 /**
3 * @name tsControllerCss
4 * @package CSS output class
5 */
7 class tsControllerCss extends tsController {
8 public $themePath;
10 private $media = 'screen';
12 /**
13 * the constructor that does it all.
14 * starts output buffering, and initializes different things
17 public function __construct(){
18 ob_start();
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 (){
35 header('Content-type: text/css');
36 $out = file_get_contents ( THEME_PATH. $this->theme . DIRECTORY_SEPARATOR .'_css'. DIRECTORY_SEPARATOR .$this->media.'.css');
37 $this->postDispatch ( $out );
41 private function postDispatch ($incString){
42 if (stristr ($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
43 $incString = str_replace(array('min-width:', 'max-width:'), 'width:', $incString);
45 echo $incString;