diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index 5e3636f92..5c7851542 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -1,5 +1,4 @@ view->enabledModules = Icinga::app()->getModuleManager()->listEnabledModules(); } - /** - * Display a module's documentation - */ - public function viewAction() - { - $this->populateView($this->getParam('name')); - } - /** * Provide run-time dispatching of module documentation * - * @param string $methodName - * @param array $args + * @param string $methodName + * @param array $args * * @return mixed */ public function __call($methodName, $args) { - // TODO(el): Setup routing to retrieve module name as param and point route to moduleAction - $moduleManager = Icinga::app()->getModuleManager(); - $moduleName = substr($methodName, 0, -6); // Strip 'Action' suffix - if (!$moduleManager->hasEnabled($moduleName)) { - // TODO(el): Throw a not found exception once the code has been moved to the moduleAction (see TODO above) + $moduleManager = Icinga::app()->getModuleManager(); + $moduleName = substr($methodName, 0, -6); // Strip 'Action' suffix + if (! $moduleManager->hasEnabled($moduleName)) { + // TODO(el): Distinguish between not enabled and not installed return parent::__call($methodName, $args); } - $this->_helper->redirector->gotoSimpleAndExit('view', null, null, array('name' => $moduleName)); + $this->renderDocAndToc($moduleName); } } -// @codingStandardsIgnoreEnd