doc/modules/index: Only list modules which have the 'doc' directory

refs #4820
This commit is contained in:
Eric Lippmann 2014-06-30 11:43:25 +02:00
parent 25a73ea3a1
commit e73471030c
2 changed files with 12 additions and 4 deletions

View File

@ -2,18 +2,26 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
use \Zend_Controller_Action_Exception;
use Zend_Controller_Action_Exception;
use Icinga\Application\Icinga;
use Icinga\Module\Doc\DocController;
class Doc_ModuleController extends DocController
{
/**
* List available modules
* List modules which are enabled and having the 'doc' directory
*/
public function indexAction()
{
$this->view->enabledModules = Icinga::app()->getModuleManager()->listEnabledModules();
$moduleManager = Icinga::app()->getModuleManager();
$modules = array();
foreach (Icinga::app()->getModuleManager()->listEnabledModules() as $enabledModule) {
$docDir = $moduleManager->getModuleDir($enabledModule, '/doc');
if (is_dir($docDir)) {
$modules[] = $enabledModule;
}
}
$this->view->modules = $modules;
}
/**

View File

@ -1,6 +1,6 @@
<h1>Module documentations</h1>
<ul>
<?php foreach ($enabledModules as $module): ?>
<?php foreach ($modules as $module): ?>
<li>
<a href="<?= $this->getHelper('Url')->url(array('moduleName' => $module), 'doc/module/toc', false, false); ?>">
<?= $module ?>