diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 337b7ba..ca6d283 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -155,15 +155,18 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $path = $this->getHelpModulePath($request); - $toParse = \file_get_contents($path); - $summary = \file_get_contents(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md'); + $toParse = \file_get_contents($path); + $summary = \file_get_contents(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md'); + $devSummary = \file_get_contents(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Dev/en/SUMMARY.md'); - $content = Markdown::parse($toParse === false ? '' : $toParse); - $navigation = Markdown::parse($summary === false ? '' : $summary); + $content = Markdown::parse($toParse === false ? '' : $toParse); + $navigation = Markdown::parse($summary === false ? '' : $summary); + $devNavigation = $devSummary === false ? null : Markdown::parse($devSummary); $view->setTemplate('/Modules/Help/Theme/Backend/help-module'); $view->setData('content', $content); $view->setData('navigation', $navigation); + $view->setData('devNavigation', $devNavigation); return $view; } @@ -180,15 +183,18 @@ final class BackendController extends Controller */ private function getHelpModulePath(RequestAbstract $request) : string { + $type = ''; if ($request->getData('page') === 'table-of-contencts' || $request->getData('page') === null) { $page = 'introduction'; } else { - $page = $request->getData('page'); + $typePos = \stripos($request->getData('page'), '/'); + $page = \substr($request->getData('page'), $typePos + 1); + $type = \substr($request->getData('page'), 0, $typePos); } - $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/' . $page . '.md'); + $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $request->getHeader()->getL11n()->getLanguage() . '/' . $page . '.md'); if ($path === false) { - $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/introduction.md'); + $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $request->getHeader()->getL11n()->getLanguage() . '/introduction.md'); } return $path === false ? '' : $path; diff --git a/Docs/Help/en/SUMMARY.md b/Docs/Help/en/SUMMARY.md index 1aa7e99..ee41ebe 100644 --- a/Docs/Help/en/SUMMARY.md +++ b/Docs/Help/en/SUMMARY.md @@ -1,3 +1,3 @@ -# Table of Contents +# User Content -* [Documentation]({%}&page=documentation) \ No newline at end of file +* [Documentation]({%}&page=Help/documentation) \ No newline at end of file diff --git a/Docs/Help/en/documentation.md b/Docs/Help/en/documentation.md index 1368154..25d1dca 100644 --- a/Docs/Help/en/documentation.md +++ b/Docs/Help/en/documentation.md @@ -9,9 +9,9 @@ Mandatory files are a `SUMMARY.md` file which contains the list of all documents ```md # Table of Contents -* [Link Name 1]({%}&page=document_name_1) -* [Link Name 2]({%}&page=document_name_2) -* [Link Name 3]({%}&page=document_name_3) +* [Link Name 1]({%}&page=Help/document_name_1) +* [Link Name 2]({%}&page=Help/document_name_2) +* [Link Name 3]({%}&page=Help/document_name_3) ``` ![Directory Structure](Modules/Help/Docs/Help/img/directory_structure.png) \ No newline at end of file diff --git a/Theme/Backend/help-module.tpl.php b/Theme/Backend/help-module.tpl.php index 7b3c954..ad51eaa 100644 --- a/Theme/Backend/help-module.tpl.php +++ b/Theme/Backend/help-module.tpl.php @@ -17,5 +17,13 @@ getData('navigation'); ?> + + hasData('devNavigation')) : ?> +
+
+ getData('devNavigation'); ?> +
+
+ \ No newline at end of file