Doc: Add action to display a chapter of Icinga Web 2's documentation

Note that the FULL documentation is displayed yet.

refs #4820
This commit is contained in:
Eric Lippmann 2014-05-27 15:07:49 +02:00
parent dad7dc9e6c
commit e78d98a607
1 changed files with 15 additions and 0 deletions

View File

@ -2,6 +2,7 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
use \Zend_Controller_Action_Exception;
use Icinga\Application\Icinga;
use Icinga\Module\Doc\DocController;
@ -14,4 +15,18 @@ class Doc_IcingawebController extends DocController
{
$this->renderToc(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2');
}
/**
* View a chapter of Icinga Web 2's documentation
*
* @throws Zend_Controller_Action_Exception
*/
public function chapterAction()
{
$chapterName = $this->getParam('chapterName');
if ($chapterName === null) {
throw new Zend_Controller_Action_Exception('Missing parameter "chapterName"', 404);
}
$this->renderChapter($chapterName, Icinga::app()->getApplicationDir('/../doc'));
}
}