Changeset 466
- Timestamp:
- 09/01/2007 05:04:16 PM (13 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 modified
-
application/config/mimes.php (added)
-
modules/user_guide/controllers/user_guide.php (modified) (1 diff)
-
system/libraries/View.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/user_guide/controllers/user_guide.php
r464 r466 62 62 url::redirect($ajax_return); 63 63 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'); 66 67 67 68 // Display output 68 $t his->load->view('user_guide/template', $this->data)->render(TRUE);69 $template->render(TRUE); 69 70 } 70 71 } -
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.'); 2 2 /** 3 3 * Kohana … … 33 33 class View_Core { 34 34 35 // The view file name and type 35 36 private $kohana_filename = FALSE; 36 private $kohana_renderer = FALSE;37 37 private $kohana_filetype = FALSE; 38 private $kohana_protected = FALSE; 38 39 // Set variables 39 40 private $data = array(); 40 41 … … 44 45 { 45 46 $type = $type[1]; 47 46 48 $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)); 56 50 } 57 51 else 58 52 { 59 53 $this->kohana_filename = Kohana::find_file('views', $name, TRUE); 54 $this->kohana_filetype = EXT; 60 55 } 61 56 … … 105 100 public function render($print = FALSE, $callback = FALSE) 106 101 { 107 if ($this->kohana_filetype == FALSE)102 if ($this->kohana_filetype == EXT) 108 103 { 109 104 $output = Kohana::instance()->kohana_include_view($this->kohana_filename, $this->data);
