From e78d98a60786b14e2cb7fbb498587013f1046704 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 27 May 2014 15:07:49 +0200 Subject: [PATCH] Doc: Add action to display a chapter of Icinga Web 2's documentation Note that the FULL documentation is displayed yet. refs #4820 --- .../controllers/IcingawebController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index f9e05cefd..5ddc4d323 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -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')); + } }