70 lines
2.6 KiB
PHTML
70 lines
2.6 KiB
PHTML
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @var string $renderedHtml Rendered markdown HTML
|
||
|
|
* @var array<int, array<string, mixed>> $tocItems TOC headings [{level, text, anchor}]
|
||
|
|
* @var array<string, array<string, string>> $docGroups Grouped doc navigation
|
||
|
|
* @var string $currentSlug Active slug
|
||
|
|
* @var string $currentTitle Active doc title
|
||
|
|
*/
|
||
|
|
?>
|
||
|
|
|
||
|
|
<div class="app-docs-container">
|
||
|
|
|
||
|
|
<aside class="app-docs-nav" aria-label="<?php e(t('Documentation navigation')); ?>">
|
||
|
|
<nav>
|
||
|
|
<?php foreach ($docGroups as $groupLabel => $items): ?>
|
||
|
|
<div class="app-docs-nav-group">
|
||
|
|
<small class="muted"><?php e($groupLabel); ?></small>
|
||
|
|
<ul>
|
||
|
|
<?php foreach ($items as $docSlug => $label): ?>
|
||
|
|
<?php $isActive = $docSlug === $currentSlug; ?>
|
||
|
|
<li>
|
||
|
|
<a href="<?php e(lurl('admin/docs/' . $docSlug)); ?>"
|
||
|
|
class="<?php e($isActive ? 'active' : ''); ?>"
|
||
|
|
<?php if ($isActive): ?>aria-current="page" <?php endif; ?>>
|
||
|
|
<?php e($label); ?>
|
||
|
|
</a>
|
||
|
|
</li>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</nav>
|
||
|
|
</aside>
|
||
|
|
|
||
|
|
<article class="app-docs-content">
|
||
|
|
<?php
|
||
|
|
$breadcrumbs = [
|
||
|
|
['label' => t('Home'), 'path' => 'admin'],
|
||
|
|
['label' => t('Documentation'), 'path' => 'admin/docs/erste-schritte'],
|
||
|
|
['label' => $currentTitle],
|
||
|
|
];
|
||
|
|
require templatePath('partials/app-breadcrumb.phtml');
|
||
|
|
?>
|
||
|
|
<?php MintyPHP\Buffer::get('docs_rendered_html'); ?>
|
||
|
|
</article>
|
||
|
|
|
||
|
|
<?php if ($tocItems): ?>
|
||
|
|
<aside class="app-docs-toc" aria-label="<?php e(t('On this page')); ?>">
|
||
|
|
<small class="muted"><?php e(t('On this page')); ?></small>
|
||
|
|
<ul>
|
||
|
|
<?php foreach ($tocItems as $item): ?>
|
||
|
|
<li class="app-docs-toc-level-<?php e((string) $item['level']); ?>">
|
||
|
|
<a href="<?php e(lurl('admin/docs/' . $currentSlug) . '#' . $item['anchor']); ?>"><?php e($item['text']); ?></a>
|
||
|
|
</li>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</ul>
|
||
|
|
</aside>
|
||
|
|
<?php endif; ?>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
window.addEventListener('DOMContentLoaded', function () {
|
||
|
|
document.querySelectorAll('.app-docs-content li > input[type="checkbox"][disabled]').forEach(function (checkbox) {
|
||
|
|
checkbox.removeAttribute('disabled');
|
||
|
|
});
|
||
|
|
});
|
||
|
|
</script>
|