2014-02-03 09:39:53 -05:00
|
|
|
<?php
|
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Doc;
|
|
|
|
|
|
2014-06-06 08:10:35 -04:00
|
|
|
use Icinga\Data\Tree\NodeRenderer;
|
2014-02-03 09:39:53 -05:00
|
|
|
use Icinga\Web\Controller\ActionController;
|
|
|
|
|
|
2014-05-27 08:48:35 -04:00
|
|
|
class DocController extends ActionController
|
2014-02-03 09:39:53 -05:00
|
|
|
{
|
|
|
|
|
/**
|
2014-06-06 08:10:35 -04:00
|
|
|
* Populate a chapter
|
2014-02-03 09:39:53 -05:00
|
|
|
*
|
2014-05-27 09:06:48 -04:00
|
|
|
* @param string $chapterName Name of the chapter
|
|
|
|
|
* @param string $path Path to the documentation
|
2014-02-03 09:39:53 -05:00
|
|
|
*/
|
2014-06-06 08:10:35 -04:00
|
|
|
protected function populateChapter($chapterName, $path)
|
2014-02-03 09:39:53 -05:00
|
|
|
{
|
2014-05-27 09:06:48 -04:00
|
|
|
$parser = new DocParser($path);
|
2014-06-06 08:10:35 -04:00
|
|
|
$this->view->chapterHtml = $parser->getChapter($chapterName);
|
|
|
|
|
$this->view->toc = $parser->getToc();
|
2014-02-03 09:39:53 -05:00
|
|
|
}
|
2014-05-27 08:49:32 -04:00
|
|
|
|
|
|
|
|
/**
|
2014-05-28 11:16:37 -04:00
|
|
|
* Populate toc
|
2014-05-27 08:49:32 -04:00
|
|
|
*
|
|
|
|
|
* @param string $path Path to the documentation
|
2014-05-27 09:06:48 -04:00
|
|
|
* @param string $name Name of the documentation
|
2014-05-27 08:49:32 -04:00
|
|
|
*/
|
2014-05-28 11:16:37 -04:00
|
|
|
protected function populateToc($path, $name)
|
2014-05-27 08:49:32 -04:00
|
|
|
{
|
|
|
|
|
$parser = new DocParser($path);
|
2014-06-06 08:10:35 -04:00
|
|
|
$toc = $parser->getToc();
|
|
|
|
|
$this->view->tocRenderer = new NodeRenderer($toc);
|
2014-05-27 08:49:32 -04:00
|
|
|
$this->view->docName = $name;
|
|
|
|
|
}
|
2014-05-23 03:36:14 -04:00
|
|
|
}
|