Show
Ignore:
Timestamp:
12/27/2007 10:12:51 AM (11 months ago)
Author:
PugFish
Message:

Couple of fixes for Kodoc media loading

Files:
1 modified

Legend:

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

    r1330 r1621  
    2525        public function media() 
    2626        { 
     27                if (isset($this->profiler)) $this->profiler->disable(); 
     28 
    2729                // Get the filename 
    2830                $file = implode('/', $this->uri->segment_array(1)); 
     31                $ext = strrchr($file, '.'); 
     32 
     33                if ($ext !== FALSE) 
     34                { 
     35                        $file = substr($file, 0, -strlen($ext)); 
     36                        $ext = substr($ext, 1); 
     37                } 
    2938 
    3039                // Disable auto-rendering 
     
    3443                { 
    3544                        // Attempt to display the output 
    36                         echo new View('kodoc/'.$file); 
     45                        echo new View('kodoc/'.$file, NULL, $ext); 
    3746                } 
    3847                catch (Kohana_Exception $e)