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 (){
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);