Add developer doc

This commit is contained in:
Dennis Eichhorn 2018-07-06 21:34:11 +02:00
parent dc43e0edd5
commit d2262885b1
2 changed files with 30 additions and 6 deletions

View File

@ -124,9 +124,8 @@ final class Controller extends ModuleAbstract implements WebInterface
}
if ($path === false) {
$view->setTemplate('/Web/Backend/Error/403_inline');
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
return $view;
$path = \realpath(__DIR__ . '/../../Documentation/README.md');
}
$content = Markdown::parse(\file_get_contents($path));
@ -210,9 +209,24 @@ final class Controller extends ModuleAbstract implements WebInterface
public function viewHelpDeveloper(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Help/Theme/Backend/help-developer');
$view->setData('markdown', Markdown::parse(file_get_contents(__DIR__ . '/../../Developer-Guide/README.md')));
if ($request->getData('page') === 'README' || $request->getData('page') === null) {
$path = \realpath(__DIR__ . '/../../Developer-Guide/README.md');
} else {
$path = \realpath(__DIR__ . '/../../Developer-Guide/' . $request->getData('page') . '.md');
}
if ($path === false) {
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
$path = \realpath(__DIR__ . '/../../Developer-Guide/README.md');
}
$content = Markdown::parse(\file_get_contents($path));
$navigation = Markdown::parse(\file_get_contents(__DIR__ . '/../../Developer-Guide/SUMMARY.md'));
$view->setTemplate('/Modules/Help/Theme/Backend/help-developer');
$view->setData('content', $content);
$view->setData('navigation', $navigation);
return $view;
}

View File

@ -1,9 +1,19 @@
<div class="row">
<div class="col-xs-12">
<div class="col-xs-12 col-md-8 col-lg-9">
<section class="box wf-100">
<div class="inner">
<article>
<?= $this->getData('markdown'); ?>
<?= $this->getData('content'); ?>
</article>
</div>
</section>
</div>
<div class="col-xs-12 col-md-4 col-lg-3">
<section class="box wf-100">
<div class="inner">
<article>
<?= $this->getData('navigation'); ?>
</article>
</div>
</section>