From 178402b65c80e5029be43ddad74636d83c1f698f Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 27 May 2014 15:09:01 +0200 Subject: [PATCH] Doc: Add action to view a chapter of a module's documentation Note that the FULL documentation is displayed yet. refs #4820 --- .../controllers/ModuleController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index cdeca3e50..fd74050ec 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -47,4 +47,21 @@ class Doc_ModuleController extends DocController $moduleManager = Icinga::app()->getModuleManager(); $this->renderToc($moduleManager->getModuleDir($moduleName, '/doc'), $moduleName); } + + /** + * View a chapter of a module's documentation + * + * @throws Zend_Controller_Action_Exception + */ + public function chapterAction() + { + $moduleName = $this->getParam('moduleName'); + $this->assertModuleEnabled($moduleName); + $chapterName = $this->getParam('chapterName'); + if ($chapterName === null) { + throw new Zend_Controller_Action_Exception('Missing parameter "chapterName"', 404); + } + $moduleManager = Icinga::app()->getModuleManager(); + $this->renderChapter($chapterName, $moduleManager->getModuleDir($moduleName, '/doc')); + } }