2014-05-23 09:40:00 +02:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
2014-09-04 14:53:00 +02:00
|
|
|
use \Zend_Controller_Action_Exception;
|
2014-05-27 14:50:48 +02:00
|
|
|
use Icinga\Application\Icinga;
|
|
|
|
use Icinga\Module\Doc\DocController;
|
2014-05-23 09:40:00 +02:00
|
|
|
|
|
|
|
class Doc_IcingawebController extends DocController
|
|
|
|
{
|
2014-12-09 12:50:29 +01:00
|
|
|
/**
|
|
|
|
* Get the path to Icinga Web 2's documentation
|
|
|
|
*/
|
|
|
|
protected function getDocPath()
|
|
|
|
{
|
|
|
|
return $this->Config()->get('documentation', 'path', Icinga::app()->getBaseDir('doc'));
|
|
|
|
}
|
|
|
|
|
2014-05-27 14:50:48 +02:00
|
|
|
/**
|
2014-07-28 19:17:03 +02:00
|
|
|
* View the toc of Icinga Web 2's documentation
|
2014-05-27 14:50:48 +02:00
|
|
|
*/
|
|
|
|
public function tocAction()
|
2014-05-23 09:40:00 +02:00
|
|
|
{
|
2014-12-09 12:50:29 +01:00
|
|
|
return $this->renderToc($this->getDocPath(), 'Icinga Web 2', 'doc/icingaweb/chapter');
|
2014-05-23 09:40:00 +02:00
|
|
|
}
|
2014-05-27 15:07:49 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* View a chapter of Icinga Web 2's documentation
|
|
|
|
*
|
2014-08-19 09:45:53 +02:00
|
|
|
* @throws Zend_Controller_Action_Exception If the required parameter 'chapterId' is missing
|
2014-05-27 15:07:49 +02:00
|
|
|
*/
|
|
|
|
public function chapterAction()
|
|
|
|
{
|
2014-08-19 09:45:53 +02:00
|
|
|
$chapterId = $this->getParam('chapterId');
|
|
|
|
if ($chapterId === null) {
|
2014-07-28 19:17:03 +02:00
|
|
|
throw new Zend_Controller_Action_Exception(
|
2014-08-19 09:45:53 +02:00
|
|
|
$this->translate('Missing parameter \'chapterId\''),
|
2014-07-28 19:17:03 +02:00
|
|
|
404
|
|
|
|
);
|
2014-05-27 15:07:49 +02:00
|
|
|
}
|
2014-11-20 15:29:46 +01:00
|
|
|
return $this->renderChapter(
|
2014-12-09 12:50:29 +01:00
|
|
|
$this->getDocPath(),
|
2014-08-19 11:30:56 +02:00
|
|
|
$chapterId,
|
|
|
|
'doc/icingaweb/toc',
|
|
|
|
'doc/icingaweb/chapter'
|
|
|
|
);
|
2014-07-28 19:17:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* View Icinga Web 2's documentation as PDF
|
|
|
|
*/
|
|
|
|
public function pdfAction()
|
|
|
|
{
|
2014-12-09 12:50:29 +01:00
|
|
|
return $this->renderPdf($this->getDocPath(), 'Icinga Web 2', 'doc/icingaweb/chapter');
|
2014-05-27 15:07:49 +02:00
|
|
|
}
|
2014-05-23 09:40:00 +02:00
|
|
|
}
|