2014-02-03 15:39:53 +01:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
|
|
namespace Icinga\Module\Doc;
|
|
|
|
|
|
|
|
use Icinga\Web\Controller\ActionController;
|
|
|
|
|
2014-05-27 14:48:35 +02:00
|
|
|
class DocController extends ActionController
|
2014-02-03 15:39:53 +01:00
|
|
|
{
|
|
|
|
/**
|
2014-05-27 15:06:48 +02:00
|
|
|
* Render 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-05-27 15:06:48 +02:00
|
|
|
protected function renderChapter($chapterName, $path)
|
2014-02-03 15:39:53 +01:00
|
|
|
{
|
2014-05-27 15:06:48 +02:00
|
|
|
$parser = new DocParser($path);
|
2014-05-23 09:36:14 +02:00
|
|
|
list($docHtml, $docToc) = $parser->getDocAndToc();
|
2014-05-27 15:06:48 +02:00
|
|
|
$this->view->chapterHtml = $docHtml;
|
|
|
|
$this->_helper->viewRenderer('partials/chapter', null, true);
|
2014-02-03 15:39:53 +01:00
|
|
|
}
|
2014-05-27 14:49:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Render a toc
|
|
|
|
*
|
|
|
|
* @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
|
|
|
*/
|
|
|
|
protected function renderToc($path, $name)
|
|
|
|
{
|
|
|
|
$parser = new DocParser($path);
|
|
|
|
list($docHtml, $docToc) = $parser->getDocAndToc();
|
|
|
|
$this->view->docToc = $docToc;
|
|
|
|
$this->view->docName = $name;
|
|
|
|
$this->_helper->viewRenderer('partials/toc', null, true);
|
|
|
|
}
|
2014-05-23 09:36:14 +02:00
|
|
|
}
|