Changeset 486
- Timestamp:
- 09/03/2007 08:49:02 PM (13 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 1 removed
- 7 modified
-
modules/user_guide/controllers/user_guide.php (modified) (1 diff)
-
modules/user_guide/i18n (added)
-
modules/user_guide/i18n/en (added)
-
modules/user_guide/i18n/en/user_guide.php (added)
-
modules/user_guide/views/user_guide/css/layout.css (modified) (1 diff)
-
modules/user_guide/views/user_guide/css/spinner.gif (deleted)
-
modules/user_guide/views/user_guide/en/template.php (modified) (3 diffs)
-
modules/user_guide/views/user_guide/js/effects.js (modified) (2 diffs)
-
system/core/Kohana.php (modified) (2 diffs)
-
system/helpers/html.php (modified) (1 diff)
-
system/libraries/View.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/user_guide/controllers/user_guide.php
r485 r486 41 41 $content = rtrim('user_guide/'.$locale.'content/'.$category.'/'.$section, '/'); 42 42 43 $template = $this->load->view('user_guide/'.$locale.'template');44 $template->menu = $this->load->view('user_guide/'.$locale.'menu', array('active_category' => $category, 'active_section' => $section));45 $template->content = $this->load->view($content)->render(FALSE, array($this, '_tags'));46 47 43 // Display output 48 $template->render(TRUE); 44 $this->load->view('user_guide/'.$locale.'template', array 45 ( 46 'active_category' => $category, 47 'active_section' => $section, 48 'content' => $this->load->view($content)->render(FALSE, array($this, '_tags')) 49 ))->render(TRUE); 49 50 } 50 51 -
trunk/modules/user_guide/views/user_guide/css/layout.css
r475 r486 43 43 #body li { padding: 0.1em 0; } 44 44 #footer { padding: 0 1em; background: #fff; line-height: 2em; } 45 #loading { position: absolute; top: 0; right: 0; z-index: 9999; width: 32px; height: 32px; background: transparent url(spinner.gif) center center no-repeat; }46 45 /* 47 46 Content Styles -
trunk/modules/user_guide/views/user_guide/en/template.php
r479 r486 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict// EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang=" en" lang="en">1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//<?php echo strtoupper(Config::item('core.locale')) ?>" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo Config::item('core.locale') ?>" lang="<?php echo Config::item('core.locale') ?>"> 3 3 <head> 4 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 5 5 6 <title> Kohana User Guide</title>6 <title><?php echo Kohana::lang('user_guide.title') ?></title> 7 7 8 <link type="text/css" rel="stylesheet" href="<?php echo url::base(TRUE) ?>user_guide/css/layout.css" /> 9 <link type="text/css" rel="stylesheet" href="<?php echo url::base(TRUE) ?>user_guide/css/prettify.css" /> 8 <?php 10 9 11 <script type="text/javascript" src="<?php echo url::base(TRUE) ?>user_guide/js/jquery.js"></script> 12 <script type="text/javascript" src="<?php echo url::base(TRUE) ?>user_guide/js/plugins.js"></script> 13 <script type="text/javascript" src="<?php echo url::base(TRUE) ?>user_guide/js/prettify.js"></script> 14 <script type="text/javascript" src="<?php echo url::base(TRUE) ?>user_guide/js/effects.js"></script> 10 echo html::stylesheet(array 11 ( 12 'user_guide/css/layout', 13 'user_guide/css/prettify' 14 ), TRUE) 15 16 ?> 17 18 <?php 19 20 echo html::script(array 21 ( 22 'user_guide/js/jquery', 23 'user_guide/js/plugins', 24 'user_guide/js/prettify', 25 'user_guide/js/effects' 26 ), TRUE) 27 28 ?> 15 29 16 30 </head> … … 18 32 <div id="container"> 19 33 34 <!-- @start Menu --> 20 35 <div id="menu"> 21 <?php echo $menu ?> 36 <ul> 37 <?php 38 39 foreach(Kohana::lang('user_guide.menu') as $category => $menu): 40 41 $active = (strtolower($category) == $active_category) ? ' active' : ''; 42 43 ?> 44 <li class="first<?php echo $active ?>"><span><?php echo $category ?></span><ul> 45 <?php 46 47 foreach($menu as $section): 48 49 $active = (strtolower($section) == $active_section) ? 'lite' : ''; 50 51 ?> 52 <li class="<?php echo $active ?>"><?php echo html::anchor(strtolower('user_guide/'.$category.'/'.$section), $section) ?></li> 53 <?php 54 55 endforeach; 56 57 ?> 58 </ul></li> 59 <?php 60 61 endforeach; 62 63 ?> 64 </ul> 22 65 </div> 23 66 <!-- @end Menu --> 24 67 <!-- @start Body --> 25 68 <div id="body"> … … 27 70 </div> 28 71 <!-- @end Body --> 29 30 72 <!-- @start Footer --> 31 <div id="footer"> 32 <p id="copyright">copyright (c) <?php echo date('Y') ?> Kohana Team :: All rights reserved :: Rendered in {execution_time} seconds using {memory_usage}MB of memory</p> 33 </div> 73 <div id="footer"><p id="copyright"><?php echo sprintf(Kohana::lang('user_guide.copyright'), date('Y')) ?></p></div> 34 74 <!-- @end Footer --> 35 75 -
trunk/modules/user_guide/views/user_guide/js/effects.js
r485 r486 1 1 // $Id$ 2 2 $(document).ready(function(){ 3 // Menu opacity hover effect, much fancy pants! 4 $('#menu').css('opacity', 0.7).hover(function(){ 5 $(this).fadeTo(100, 1); 6 }, function(){ 7 $(this).fadeTo(300, 0.7) 8 }); 3 // Opacity animations in an element with an opacity of 1.0 cause Firefox bugs 4 $('#menu').css('opacity', 0.9999); 9 5 // Apply menu sliding effect 10 6 $('#menu li.first').click(function(){ 11 // Define the current menu and the clicked menu12 var curr = $('#menu li.active');13 var self = $(this);14 7 // Clicks to the same menu will do nothing 15 if (self.is('.active') == false) 16 { 17 // Hide the current elements 18 curr.removeClass('active') 8 if ($(this).is('.active') == false){ 9 // Hide the current submenu 10 $('#menu li.active').removeClass('active') 19 11 .find('ul') 20 . slideUp(250);21 // Show the new elements22 self.addClass('active')12 .animate({height: 'hide', opacity: 'hide'}, 200, 'easeout'); 13 // Show the clicked submenu 14 $(this).addClass('active') 23 15 .find('ul') 24 .slideDown( 250);16 .slideDown({height: 'show', opacity: 'show'}, 200, 'easein'); 25 17 } 26 18 }) … … 28 20 .not('.active').find('ul').hide(); 29 21 // For syntax highlighting 30 prettyPrint();22 if ($('.prettyprint').length) prettyPrint(); 31 23 }); -
trunk/system/core/Kohana.php
r475 r486 428 428 } 429 429 430 public static function lang($type = FALSE, $name = TRUE)430 public static function lang($type) 431 431 { 432 432 static $found = array(); 433 433 434 // Throw an exception if the type is not specified 435 if ($type == FALSE) 436 throw new Kohana_Exception('A language message type must be used when calling <code>Kohan::lang()</code>.'); 434 if (strpos($type, '.') !== FALSE) 435 { 436 list ($type, $name) = explode('.', $type); 437 } 438 else 439 { 440 $name = TRUE; 441 } 437 442 438 443 if ( ! isset($found[$type])) … … 531 536 protected $code = 0; 532 537 533 534 538 function __construct($error) 535 539 { 536 540 // Fetch the error message 537 $message = Kohana::lang('exceptions ',$error);541 $message = Kohana::lang('exceptions.'.$error); 538 542 539 543 // Handle error messages that are not set -
trunk/system/helpers/html.php
r475 r486 103 103 } 104 104 105 public static function stylesheet($style, $index = FALSE, $media = FALSE) 106 { 107 $compiled = ''; 108 109 if (is_array($style)) 110 { 111 foreach($style as $name) 112 { 113 $compiled .= self::stylesheet($name, $index, $media)."\n"; 114 } 115 } 116 else 117 { 118 $media = ($media == FALSE) ? '' : ' media="'.$media.'"'; 119 120 $compiled = '<link rel="stylesheet" href="'.url::base($index).$style.'.css"'.$media.' />'; 121 } 122 123 return $compiled; 124 } 125 126 /** 127 * Script generator 128 * 129 * @access public 130 * @param mixed String or array of script names 131 * @param boolean Add index to the URL 132 * @return string 133 */ 134 public static function script($script, $index = FALSE) 135 { 136 $compiled = ''; 137 138 if (is_array($script)) 139 { 140 foreach($script as $name) 141 { 142 $compiled .= self::script($name, $index)."\n"; 143 } 144 } 145 else 146 { 147 $compiled = '<script type="text/javascript" src="'.url::base($index).$script.'.js"></script>'; 148 } 149 150 return $compiled; 151 } 152 105 153 /** 106 154 * HTML Attribute Parser -
trunk/system/libraries/View.php
r475 r486 106 106 107 107 // Pass the output through the user defined renderer 108 if ($renderer == TRUE AND is_callable($renderer, FALSE, $renderer))108 if ($renderer == TRUE AND is_callable($renderer, TRUE)) 109 109 { 110 $output = $renderer($output);110 $output = call_user_func($renderer, $output); 111 111 } 112 112
