doc: Add view script for the toc of Icinga Web 2's doc

refs #4820
This commit is contained in:
Eric Lippmann 2014-05-28 17:18:57 +02:00
parent d3a9f17fc2
commit 72ab5027b5
2 changed files with 16 additions and 1 deletions

View File

@ -13,7 +13,7 @@ class Doc_IcingawebController extends DocController
*/
public function tocAction()
{
$this->renderToc(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2');
$this->populateToc(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2');
}
/**

View File

@ -0,0 +1,15 @@
<div class="controls">
<h1><?= $docName ?> documentation</h1>
</div>
<div class="content" data-base-target="_next">
<?php
$urlHelper = $this->getHelper('Url');
$view = $this;
?>
<?= $tocRenderer->render(function ($section) use ($urlHelper, $view) {
// Chapter name is not yet defined
$path = $urlHelper->url(array('chapterName' => 'tbd'), 'doc/icingaweb/chapter', false, false);
$url = $view->url($path)->setAnchor($section->id);
return sprintf('<li><a href="%s">%s</a></li>', $url->getAbsoluteUrl(), $section->title);
}); ?>
</div>