diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 346fa9e..2c18088 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -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; } diff --git a/Theme/Backend/help-module-list.tpl.php b/Theme/Backend/help-module-list.tpl.php index c8dea5d..e477cc0 100644 --- a/Theme/Backend/help-module-list.tpl.php +++ b/Theme/Backend/help-module-list.tpl.php @@ -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'); ?>
@@ -35,18 +34,18 @@ $modules = $this->app->moduleManager->getInstalledModules(); $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()] ); ?> - printHtml($module['name']['external']); ?> + printHtml($module->getExternalName()); ?> getHtml('Empty', '0', '0'); ?>