fix module help list

This commit is contained in:
Dennis Eichhorn 2020-02-12 19:14:04 +01:00
parent cc4af64386
commit 1628ee35bd
2 changed files with 7 additions and 6 deletions

View File

@ -126,6 +126,8 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Help/Theme/Backend/help-module-list');
$view->setData('modules', $this->app->moduleManager->getInstalledModules());
return $view;
}

View File

@ -12,12 +12,11 @@
*/
declare(strict_types=1);
/**
* @var \phpOMS\Views\View $this
* @var \phpOMS\Module\InfoManager[] $modules
*/
$modules = $this->app->moduleManager->getInstalledModules();
$modules = $this->getData('modules');
?>
<div class="row">
@ -35,18 +34,18 @@ $modules = $this->app->moduleManager->getInstalledModules();
<?php
$count = 0;
foreach ($modules as $key => $module) :
if ((\realpath(__DIR__ . '/../../../' . $module['directory'] . '/Docs/Help/en/SUMMARY.md')) === false) {
if ((\realpath(__DIR__ . '/../../../' . $module->getDirectory() . '/Docs/Help/en/SUMMARY.md')) === false) {
continue;
}
++$count;
$url = \phpOMS\Uri\UriFactory::build(
'{/lang}/backend/help/module/single?id={$module}',
['$module' => $module['name']['internal']]
['$module' => $module->getInternalName()]
);
?>
<tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['external']); ?></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module->getExternalName()); ?></a>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>