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