Updated to KH 3.3 and improved
This commit is contained in:
@@ -1,16 +1,34 @@
|
||||
<h1>
|
||||
<?php echo $doc->modifiers, $doc->class->name ?>
|
||||
<?php $parent = $doc->class; ?>
|
||||
<?php while ($parent = $parent->getParentClass()): ?>
|
||||
<?php foreach ($doc->parents as $parent): ?>
|
||||
<br/><small>extends <?php echo HTML::anchor($route->uri(array('class' => $parent->name)), $parent->name, NULL, NULL, TRUE) ?></small>
|
||||
<?php endwhile ?>
|
||||
<?php endforeach; ?>
|
||||
</h1>
|
||||
|
||||
<?php echo $doc->description ?>
|
||||
<?php if ($interfaces = $doc->class->getInterfaceNames()): ?>
|
||||
<p class="interfaces"><small>
|
||||
Implements:
|
||||
<?php
|
||||
for ($i = 0, $split = FALSE, $count = count($interfaces); $i < $count; $i++, $split = " | ")
|
||||
{
|
||||
echo $split . HTML::anchor($route->uri(array('class' => $interfaces[$i])), $interfaces[$i], NULL, NULL, TRUE);
|
||||
}
|
||||
?></small>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($child = $doc->is_transparent($doc->class->name)):?>
|
||||
<p class="note">
|
||||
This class is a transparent base class for <?php echo HTML::anchor($route->uri(array('class'=>$child)),$child) ?> and
|
||||
should not be accessed directly.
|
||||
</p>
|
||||
<?php endif;?>
|
||||
|
||||
<?php echo $doc->description() ?>
|
||||
|
||||
<?php if ($doc->tags): ?>
|
||||
<dl class="tags">
|
||||
<?php foreach ($doc->tags as $name => $set): ?>
|
||||
<?php foreach ($doc->tags() as $name => $set): ?>
|
||||
<dt><?php echo $name ?></dt>
|
||||
<?php foreach ($set as $tag): ?>
|
||||
<dd><?php echo $tag ?></dd>
|
||||
@@ -29,38 +47,38 @@ Class is not declared in a file, it is probably an internal <?php echo html::anc
|
||||
|
||||
<div class="toc">
|
||||
<div class="constants">
|
||||
<h3><?php echo __('Constants'); ?></h3>
|
||||
<h3><?php echo 'Constants'; ?></h3>
|
||||
<ul>
|
||||
<?php if ($doc->constants): ?>
|
||||
<?php foreach ($doc->constants as $name => $value): ?>
|
||||
<li><a href="#constant:<?php echo $name ?>"><?php echo $name ?></a></li>
|
||||
<?php endforeach ?>
|
||||
<?php else: ?>
|
||||
<li><em><?php echo __('None'); ?></em></li>
|
||||
<li><em><?php echo 'None'; ?></em></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="properties">
|
||||
<h3><?php echo __('Properties'); ?></h3>
|
||||
<h3><?php echo 'Properties'; ?></h3>
|
||||
<ul>
|
||||
<?php if ($properties = $doc->properties()): ?>
|
||||
<?php foreach ($properties as $prop): ?>
|
||||
<li><a href="#property:<?php echo $prop->property->name ?>">$<?php echo $prop->property->name ?></a></li>
|
||||
<?php endforeach ?>
|
||||
<?php else: ?>
|
||||
<li><em><?php echo __('None'); ?></em></li>
|
||||
<li><em><?php echo 'None'; ?></em></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="methods">
|
||||
<h3><?php echo __('Methods'); ?></h3>
|
||||
<h3><?php echo 'Methods'; ?></h3>
|
||||
<ul>
|
||||
<?php if ($methods = $doc->methods()): ?>
|
||||
<?php foreach ($methods as $method): ?>
|
||||
<li><a href="#<?php echo $method->method->name ?>"><?php echo $method->method->name ?>()</a></li>
|
||||
<?php endforeach ?>
|
||||
<?php else: ?>
|
||||
<li><em><?php echo __('None'); ?></em></li>
|
||||
<li><em><?php echo 'None'; ?></em></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -70,9 +88,9 @@ Class is not declared in a file, it is probably an internal <?php echo html::anc
|
||||
|
||||
<?php if ($doc->constants): ?>
|
||||
<div class="constants">
|
||||
<h1 id="constants"><?php echo __('Constants'); ?></h1>
|
||||
<h1 id="constants"><?php echo 'Constants'; ?></h1>
|
||||
<dl>
|
||||
<?php foreach ($doc->constants as $name => $value): ?>
|
||||
<?php foreach ($doc->constants() as $name => $value): ?>
|
||||
<dt><h4 id="constant:<?php echo $name ?>"><?php echo $name ?></h4></dt>
|
||||
<dd><?php echo $value ?></dd>
|
||||
<?php endforeach; ?>
|
||||
@@ -81,20 +99,23 @@ Class is not declared in a file, it is probably an internal <?php echo html::anc
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($properties = $doc->properties()): ?>
|
||||
<h1 id="properties"><?php echo __('Properties'); ?></h1>
|
||||
<h1 id="properties"><?php echo 'Properties'; ?></h1>
|
||||
<div class="properties">
|
||||
<dl>
|
||||
<?php foreach ($properties as $prop): ?>
|
||||
<dt><h4 id="property:<?php echo $prop->property->name ?>"><?php echo $prop->modifiers ?> <code><?php echo $prop->type ?></code> $<?php echo $prop->property->name ?></h4></dt>
|
||||
<dd><?php echo $prop->description ?></dd>
|
||||
<dd><?php echo $prop->value ?></dd>
|
||||
<?php if ($prop->default !== $prop->value): ?>
|
||||
<dd><small><?php echo __('Default value:') ?></small><br/><?php echo $prop->default ?></dd>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</dl>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($methods = $doc->methods()): ?>
|
||||
<h1 id="methods"><?php echo __('Methods'); ?></h1>
|
||||
<h1 id="methods"><?php echo 'Methods'; ?></h1>
|
||||
<div class="methods">
|
||||
<?php foreach ($methods as $method): ?>
|
||||
<?php echo View::factory('userguide/api/method')->set('doc', $method)->set('route', $route) ?>
|
||||
|
@@ -27,7 +27,7 @@
|
||||
<?php if ($doc->tags) echo View::factory('userguide/api/tags')->set('tags', $doc->tags) ?>
|
||||
|
||||
<?php if ($doc->return): ?>
|
||||
<h4><?php echo __('Return Values'); ?></h4>
|
||||
<h4><?php echo 'Return Values'; ?></h4>
|
||||
<ul class="return">
|
||||
<?php foreach ($doc->return as $set): list($type, $text) = $set; ?>
|
||||
<li><code><?php echo HTML::chars($type) ?></code><?php if ($text) echo ' - '.HTML::chars(ucfirst($text)) ?></li>
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<?php if ($doc->source): ?>
|
||||
<div class="method-source">
|
||||
<h4><?php echo __('Source Code'); ?></h4>
|
||||
<h4><?php echo 'Source Code'; ?></h4>
|
||||
<pre><code><?php echo HTML::chars($doc->source) ?></code></pre>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
@@ -1,62 +1,56 @@
|
||||
<h1><?php echo __('Available Classes') ?></h1>
|
||||
<h1><?php echo 'Available Classes' ?></h1>
|
||||
|
||||
<label>Filter:</label>
|
||||
<input type="text" id="api-filter-box" />
|
||||
<input type="text" id="kodoc-api-filter-box" />
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
$.fn.extend({
|
||||
filter_content: function(search){
|
||||
var search_regex = new RegExp(search,'gi');
|
||||
|
||||
// Run through each .class definition
|
||||
$('.class', this).each(function(k, container){
|
||||
if (search == '') {
|
||||
// If search box is empty show everything without doing any regex
|
||||
$(container).show();
|
||||
$('li', container).show();
|
||||
|
||||
// Continue
|
||||
return true;
|
||||
}
|
||||
|
||||
// Run through every anchor
|
||||
$('a', $(container)).each(function(k, anchor){
|
||||
// Keep track of the li
|
||||
var $parent = $(anchor).closest('li');
|
||||
|
||||
if ($(anchor).text().match(search_regex)) {
|
||||
// Show the li and .class parent if its a match
|
||||
$parent.show();
|
||||
$(container).show();
|
||||
} else {
|
||||
// Otherwise we can only assume to hide the li
|
||||
$parent.hide();
|
||||
}
|
||||
});
|
||||
|
||||
if ($('li:visible', $(container)).length == 0) {
|
||||
// If there are not any visible li's, the entire .class section needs to hide
|
||||
$(container).hide();
|
||||
} else {
|
||||
// Otherwise show the .class container
|
||||
$(container).show();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
api_filter: function(api_container_selector){
|
||||
$(this).keyup(function(){
|
||||
// Run the filter method on this value
|
||||
$(api_container_selector).filter_content($(this).val());
|
||||
});
|
||||
}
|
||||
})
|
||||
})(jQuery);
|
||||
var $api_container = $(api_container_selector);
|
||||
var $this = this;
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#api-filter-box').api_filter('#kodoc-main');
|
||||
});
|
||||
if ($api_container.length) {
|
||||
var $classes = $('.class', $api_container);
|
||||
var $methods = $('.methods li', $classes);
|
||||
var text = $methods.map(function(){ return $(this).text(); });
|
||||
var timeout = null;
|
||||
|
||||
this.keyup(function(){
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(filter_content, 300);
|
||||
});
|
||||
|
||||
filter_content();
|
||||
}
|
||||
|
||||
function filter_content(){
|
||||
var search = $this.val();
|
||||
var search_regex = new RegExp(search,'gi');
|
||||
|
||||
if (search == '') {
|
||||
$methods.show();
|
||||
$classes.show();
|
||||
} else {
|
||||
$classes.hide();
|
||||
$methods.hide();
|
||||
|
||||
text.each(function(i){
|
||||
if (this.match(search_regex)) {
|
||||
$($methods[i]).show().closest('.class').show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#kodoc-api-filter-box').api_filter('#kodoc-body').focus();
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
||||
<div class="class-list">
|
||||
|
@@ -1,3 +1,3 @@
|
||||
<h1>Kodoc - <?php echo __('Error'); ?></h1>
|
||||
<h1>Kodoc - <?php echo 'Error'; ?></h1>
|
||||
|
||||
<p><?php echo $message ?></p>
|
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $l = substr(I18n::$lang, 0, 2) ?>" lang="<?php echo $l ?>">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<title><?php echo $title ?> | Kohana <?php echo __('User Guide'); ?></title>
|
||||
<title><?php echo $title ?> | Kohana <?php echo 'User Guide'; ?></title>
|
||||
|
||||
<?php foreach ($styles as $style => $media) echo HTML::style($style, array('media' => $media), NULL, TRUE), "\n" ?>
|
||||
|
||||
@@ -15,29 +15,31 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="header">
|
||||
<div id="kodoc-header">
|
||||
<div class="container">
|
||||
<a href="http://kohanaframework.org/" id="logo">
|
||||
<a href="http://kohanaframework.org/" id="kodoc-logo">
|
||||
<img src="<?php echo Route::url('docs/media', array('file' => 'img/kohana.png')) ?>" />
|
||||
</a>
|
||||
<div id="menu">
|
||||
<div id="kodoc-menu">
|
||||
<ul>
|
||||
<li class="guide first">
|
||||
<a href="<?php echo Route::url('docs/guide') ?>"><?php echo __('User Guide') ?></a>
|
||||
<a href="<?php echo Route::url('docs/guide') ?>">User Guide</a>
|
||||
</li>
|
||||
<?php if (Kohana::$config->load('userguide.api_browser')): ?>
|
||||
<li class="api">
|
||||
<a href="<?php echo Route::url('docs/api') ?>"><?php echo __('API Browser') ?></a>
|
||||
<a href="<?php echo Route::url('docs/api') ?>">API Browser</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div id="kodoc-content">
|
||||
<div class="wrapper">
|
||||
<div class="container">
|
||||
<div class="span-22 prefix-1 suffix-1">
|
||||
<ul id="breadcrumb">
|
||||
<ul id="kodoc-breadcrumb">
|
||||
<?php foreach ($breadcrumb as $link => $title): ?>
|
||||
<?php if (is_string($link)): ?>
|
||||
<li><?php echo HTML::anchor($link, $title, NULL, NULL, TRUE) ?></li>
|
||||
@@ -48,14 +50,14 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span-6 prefix-1">
|
||||
<div id="topics">
|
||||
<div id="kodoc-topics">
|
||||
<?php echo $menu ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body" class="span-16 suffix-1 last">
|
||||
<div id="kodoc-body" class="span-16 suffix-1 last">
|
||||
<?php echo $content ?>
|
||||
|
||||
<?php if (Kohana::$environment === Kohana::PRODUCTION AND empty($hide_disqus)): ?>
|
||||
<?php if ($show_comments): ?>
|
||||
<div id="disqus_thread" class="clear"></div>
|
||||
<script type="text/javascript">
|
||||
var disqus_identifier = '<?php echo HTML::chars(Request::current()->uri()) ?>';
|
||||
@@ -65,7 +67,7 @@
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript><?php echo __('Please enable JavaScript to view the :anchor_open comments powered by Disqus.:anchor_close', array(':anchor_open' => '<a href="http://disqus.com/?ref_noscript=kohana">', ':anchor_close' => '</a>')); ?></noscript>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=kohana">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">Documentation comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
@@ -73,7 +75,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<div id="kodoc-footer">
|
||||
<div class="container">
|
||||
<div class="span-12">
|
||||
<?php if (isset($copyright)): ?>
|
||||
|
Reference in New Issue
Block a user