Show
Ignore:
Timestamp:
01/21/2008 06:56:39 AM (10 months ago)
Author:
Geert
Message:

Cleaning up tons of whitespace:

  • Use tabs for indenting
  • Use spaces for aligning
  • Avoid whitespace at the end of a line
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/media/controllers/media.php

    r1765 r1766  
    2121        protected $use_cache = FALSE; 
    2222        protected $cache_lifetime; 
    23          
     23 
    2424        protected $pack_css = FALSE; 
    2525        protected $pack_js = FALSE; 
    26          
     26 
    2727        public function __construct() 
    2828        { 
    2929                parent::__construct(); 
    30                  
     30 
    3131                $cache = Config::item('media.cache'); 
    3232                $this->use_cache = ($cache > 0); 
    33                  
     33 
    3434                if (is_int($cache)) 
    3535                { 
     
    4040                        $this->cache_lifetime = config::item('cache.lifetime') OR $this->cache_lifetime = 1800; 
    4141                } 
    42                  
     42 
    4343                if ($this->use_cache AND ! isset($this->cache))  
    4444                { 
    4545                        $this->load->library('cache'); 
    4646                } 
    47                  
     47 
    4848                $this->pack_css = (bool) Config::item('media.pack_css'); 
    4949                $this->pack_js = Config::item('media.pack_js'); 
    50                  
     50 
    5151                if ($this->pack_js === TRUE) 
    5252                { 
     
    5454                } 
    5555        } 
    56          
     56 
    5757        public function css() 
    5858        { 
     
    6262                        $filename = substr($filename, 0, -4); 
    6363                } 
    64                  
     64 
    6565                $mimetype = config::item('mimes.css'); 
    6666                $mimetype = (isset($mimetype[0])) ? $mimetype[0] : 'text/stylesheet'; 
    67                  
     67 
    6868                $this->use_cache AND $data = $this->cache->get('media.css.'.$filename); 
    69                  
     69 
    7070                if ( ! isset($data) OR empty($data)) 
    7171                { 
     
    8787                                } 
    8888                        } 
    89                          
     89 
    9090                        if (isset($view)) 
    9191                        { 
    9292                                $data = $view->render(); 
    93                                  
     93 
    9494                                if ($this->pack_css)  
    9595                                { 
    9696                                        $data = $this->_css_compress($data); 
    9797                                } 
    98                                  
     98 
    9999                                if ($this->use_cache)  
    100100                                { 
     
    107107                        } 
    108108                } 
    109                  
     109 
    110110                $mimetype AND header('Content-type: '.$mimetype); 
    111111                echo $data; 
     
    119119                        $filename = substr($filename, 0, -3); 
    120120                } 
    121                  
     121 
    122122                $mimetype = Config::item('mimes.js'); 
    123123                $mimetype = (isset($mimetype[0])) ? $mimetype[0] : 'text/javascript'; 
    124124 
    125                  
     125 
    126126                $this->use_cache AND $data = $this->cache->get('media.js.'.$filename); 
    127                  
     127 
    128128                if ( ! isset($data) OR empty($data))  
    129129                { 
     
    145145                                } 
    146146                        } 
    147                          
     147 
    148148                        if (isset($view))  
    149149                        { 
    150150                                $data = $view->render(); 
    151                                  
     151 
    152152                                if ($this->pack_js)  
    153153                                { 
     
    155155                                        $data = $packer->pack(); 
    156156                                } 
    157                                  
     157 
    158158                                if ($this->use_cache)  
    159159                                { 
     
    166166                        } 
    167167                } 
    168                  
     168 
    169169                $mimetype AND header('Content-type: '.$mimetype); 
    170170                echo $data; 
     
    184184                // Remove comments 
    185185                $data = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $data); 
    186                  
     186 
    187187                // Remove tabs, spaces, newlines, etc. 
    188188                $data = preg_replace('/\s+/s', ' ', $data);