mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
doc/modules/index: Only list modules which have the 'doc' directory
refs #4820
This commit is contained in:
parent
25a73ea3a1
commit
e73471030c
@ -2,18 +2,26 @@
|
|||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
use \Zend_Controller_Action_Exception;
|
use Zend_Controller_Action_Exception;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Module\Doc\DocController;
|
use Icinga\Module\Doc\DocController;
|
||||||
|
|
||||||
class Doc_ModuleController extends DocController
|
class Doc_ModuleController extends DocController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* List available modules
|
* List modules which are enabled and having the 'doc' directory
|
||||||
*/
|
*/
|
||||||
public function indexAction()
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<h1>Module documentations</h1>
|
<h1>Module documentations</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($enabledModules as $module): ?>
|
<?php foreach ($modules as $module): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= $this->getHelper('Url')->url(array('moduleName' => $module), 'doc/module/toc', false, false); ?>">
|
<a href="<?= $this->getHelper('Url')->url(array('moduleName' => $module), 'doc/module/toc', false, false); ?>">
|
||||||
<?= $module ?>
|
<?= $module ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user