Changeset 466

Show
Ignore:
Timestamp:
09/01/2007 05:04:16 PM (13 months ago)
Author:
Shadowhand
Message:

Small changes:

  • Added config/mimes.php
  • Updated View class to use mimes to determine the header to send
  • Fixed User Guide special tags callback
Location:
trunk
Files:
1 added
2 modified

Legend:

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

    r464 r466  
    6262                                url::redirect($ajax_return); 
    6363                         
    64                         $this->data['menu'] = $this->load->view('user_guide/menu', array('active_category' => $category, 'active_section' => $section)); 
    65                         $this->data['content'] = $this->load->view($content)->render(FALSE, 'Markdown'); 
     64                        $template = $this->load->view('user_guide/template'); 
     65                        $template->menu   = $this->load->view('user_guide/menu', array('active_category' => $category, 'active_section' => $section)); 
     66                        $template->content = $this->load->view($content)->render(FALSE, 'Markdown'); 
    6667 
    6768                        // Display output 
    68                         $this->load->view('user_guide/template', $this->data)->render(TRUE); 
     69                        $template->render(TRUE); 
    6970                } 
    7071        } 
  • trunk/system/libraries/View.php

    r462 r466  
    1 <?php  if (!defined('SYSPATH')) exit('No direct script access allowed'); 
     1<?php defined('SYSPATH') or die('No direct access allowed.'); 
    22/** 
    33 * Kohana 
     
    3333class View_Core { 
    3434 
     35        // The view file name and type 
    3536        private $kohana_filename  = FALSE; 
    36         private $kohana_renderer  = FALSE; 
    3737        private $kohana_filetype  = FALSE; 
    38         private $kohana_protected = FALSE; 
     38 
     39        // Set variables 
    3940        private $data = array(); 
    4041 
     
    4445                { 
    4546                        $type = $type[1]; 
     47 
    4648                        $this->kohana_filename = Kohana::find_file('views', $name, TRUE, $type); 
    47                          
    48                         if (function_exists('exif_imagetype')) 
    49                         { 
    50                                 $this->kohana_filetype = image_type_to_mime_type(exif_imagetype($this->kohana_filename)); 
    51                         } 
    52                         else 
    53                         { 
    54                                 $this->kohana_filetype = 'image/'.$type; 
    55                         } 
     49                        $this->kohana_filetype = current(Config::item('mimes.'.$type)); 
    5650                } 
    5751                else 
    5852                { 
    5953                        $this->kohana_filename = Kohana::find_file('views', $name, TRUE); 
     54                        $this->kohana_filetype = EXT; 
    6055                } 
    6156 
     
    105100        public function render($print = FALSE, $callback = FALSE) 
    106101        { 
    107                 if ($this->kohana_filetype == FALSE) 
     102                if ($this->kohana_filetype == EXT) 
    108103                { 
    109104                        $output = Kohana::instance()->kohana_include_view($this->kohana_filename, $this->data);