Changeset 495 for trunk/modules/user_guide
- Timestamp:
- 09/03/2007 09:41:27 PM (15 months ago)
- Location:
- trunk/modules/user_guide
- Files:
-
- 3 modified
-
controllers/user_guide.php (modified) (1 diff)
-
i18n/en/User_guide_menu.php (modified) (1 diff)
-
views/user_guide/template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/user_guide/controllers/user_guide.php
r490 r495 21 21 ) 22 22 ); 23 24 if ($this->uri->segment(2) == FALSE) 25 url::redirect('user_guide/'.Config::item('core.locale').'/kohana/about'); 23 26 } 24 27 25 28 public function _remap() 26 29 { 27 $category = strtolower($this->uri->segment(2)); 28 $section = strtolower($this->uri->segment(3)); 30 $language = strtolower($this->uri->segment(2)); 31 $category = strtolower($this->uri->segment(3)); 32 $section = strtolower($this->uri->segment(4)); 29 33 30 34 // Media resource loading 31 if ($ category === 'js' OR $category=== 'css')35 if ($language === 'js' OR $language === 'css') 32 36 { 33 return $this->$category($section); 37 return $this->$language($category); 38 } 39 elseif ($section == FALSE) 40 { 41 url::redirect('user_guide/'.$language.'/kohana/about'); 34 42 } 35 43 36 44 // Set the view that will be loaded 37 45 $category = ($category == FALSE) ? 'kohana' : $category; 38 $content = rtrim('user_guide/'.Config::item('core.locale', TRUE).$category.'/'.$section, '/'); 46 $content = 'user_guide/'.$language.'/'.$category.'/'.$section; 47 $content = rtrim($content, '/'); 39 48 40 // Display output 41 $this->load->view('user_guide/template', array 42 ( 43 'active_category' => $category, 44 'active_section' => $section, 45 'content' => $this->load->view($content)->render(FALSE, array($this, '_tags')) 46 ))->render(TRUE); 49 try 50 { 51 // Display output 52 $this->load->view('user_guide/template', array 53 ( 54 'category' => $category, 55 'section' => $section, 56 'language' => $language, 57 'content' => $this->load->view($content)->render(FALSE, array($this, '_tags')) 58 ))->render(TRUE); 59 } 60 catch (Kohana_Exception $exception) 61 { 62 trigger_error('The Kohana User Guide has not been translated into the requested language.', E_USER_ERROR); 63 } 47 64 } 48 65 -
trunk/modules/user_guide/i18n/en/User_guide_menu.php
r494 r495 1 1 <?php defined('SYSPATH') or die('No direct access allowed.'); 2 /* $Id: user_guide.php 485 2007-09-04 00:12:20Z Shadowhand $ */3 4 2 /** 5 3 * Kohana User Guide Menu 6 * Topics in Categories (Eg, General, Libraries) 7 * Articles in Sections (Eg, Installation) 8 * Libraries and Helpers are in alphabetic order 9 * Other Categories are in logical order 4 * 5 * Topics in Categories (eg: Kohana, General, Libraries) 6 * Articles in Sections (eg: Installation, Configuration, Pagination) 7 * Libraries and helpers are in alphabetical order 8 * Other categories are in logical order 9 * 10 * $Id: user_guide.php 485 2007-09-04 00:12:20Z Shadowhand $ 10 11 */ 11 12 $lang = array -
trunk/modules/user_guide/views/user_guide/template.php
r494 r495 37 37 <?php 38 38 39 foreach(Kohana::lang('user_guide_menu') as $cat egory=> $menu):39 foreach(Kohana::lang('user_guide_menu') as $cat => $menu): 40 40 41 $active = (strtolower($cat egory) == $active_category) ? ' active' : '';41 $active = (strtolower($cat) == $category) ? ' active' : ''; 42 42 43 43 ?> 44 <li class="first<?php echo $active ?>"><span><?php echo $cat egory?></span><ul>44 <li class="first<?php echo $active ?>"><span><?php echo $cat ?></span><ul> 45 45 <?php 46 46 47 foreach($menu as $sec tion):47 foreach($menu as $sec): 48 48 49 $active = (strtolower($sec tion) == $active_section) ? 'lite' : '';49 $active = (strtolower($sec) == $section) ? 'lite' : ''; 50 50 51 51 ?> 52 <li class="<?php echo $active ?>"><?php echo html::anchor(strtolower('user_guide/'.$ category.'/'.$section), $section) ?></li>52 <li class="<?php echo $active ?>"><?php echo html::anchor(strtolower('user_guide/'.$language.'/'.$cat.'/'.$sec), $sec) ?></li> 53 53 <?php 54 54 … … 65 65 </div> 66 66 <!-- @end Menu --> 67 67 68 <!-- @start Body --> 68 69 <div id="body"> … … 70 71 </div> 71 72 <!-- @end Body --> 73 72 74 <!-- @start Footer --> 73 75 <div id="footer"><p id="copyright"><?php echo sprintf(Kohana::lang('user_guide.copyright'), date('Y')) ?></p></div>
