Changeset 1329 for trunk/modules/kodoc/controllers
- Timestamp:
- 11/30/2007 01:05:23 AM (12 months ago)
- Files:
-
- 1 modified
-
trunk/modules/kodoc/controllers/kodoc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/kodoc/controllers/kodoc.php
r1297 r1329 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 3 class Kodoc_Controller extends Controller {3 class Kodoc_Controller extends Template_Controller { 4 4 5 protected $template = 'kodoc/template'; 6 7 // Kodoc instance 5 8 protected $kodoc; 9 10 public function __construct() 11 { 12 parent::__construct(); 13 14 $active = $this->uri->segment(2) ? $this->uri->segment(2) : 'core'; 15 16 // Add the menu to the template 17 $this->template->menu = new View('kodoc_menu', array('active' => $active)); 18 } 6 19 7 20 public function index() 8 21 { 9 print new View('kodoc_menu'); 22 $this->template->content = 'hi'; 23 } 24 25 public function media() 26 { 27 // Get the filename 28 $file = implode('/', $this->uri->segment_array(1)); 29 30 // Disable auto-rendering 31 $this->auto_render = FALSE; 32 33 try 34 { 35 // Attempt to display the output 36 echo new View('kodoc/'.$file); 37 } 38 catch (Kohana_Exception $e) 39 { 40 Event::run('system.404'); 41 } 10 42 } 11 43 … … 49 81 $file = Kohana::find_file($type, $file); 50 82 } 51 } 52 else 53 { 54 // Nothing to document 55 url::redirect('kodoc'); 83 84 if (in_array($type, Kodoc::get_types())) 85 { 86 // Load Kodoc 87 $this->kodoc = new Kodoc($type, $file); 88 89 // Set the title 90 $this->template->title = implode('/', $this->uri->segment_array(1)); 91 92 // Load documentation for this file 93 $this->template->content = new View('kodoc_html'); 94 95 // Exit this method 96 return; 97 } 56 98 } 57 99 58 if (in_array($type, Kodoc::get_types())); 59 { 60 $this->kodoc = new Kodoc($type, $file); 61 62 $content = new View('kodoc_html'); 63 64 print $content; 65 } 66 67 print Kohana::lang('core.stats_footer'); 100 // Nothing to document 101 url::redirect('kodoc'); 68 102 } 69 103 70 } 104 } // End Kodoc Controller
