szurubooru/src/Views/index-help.phtml

37 lines
838 B
PHTML
Raw Normal View History

2013-11-21 15:16:27 +01:00
<?php
2014-04-29 21:35:29 +02:00
Assets::setSubtitle('help');
Assets::addStylesheet('index-help.css');
2014-04-29 21:35:29 +02:00
$tabs = getConfig()->help->subTitles;
2013-11-21 15:16:27 +01:00
$firstTab = !empty($tabs) ? array_keys($tabs)[0] : null;
2014-02-16 11:44:42 +01:00
$showTabs = count($tabs) > 1;
2013-11-21 15:16:27 +01:00
?>
2014-02-16 11:44:42 +01:00
<?php if ($showTabs): ?>
<nav class="tabs">
<ul>
<?php foreach ($tabs as $tab => $text): ?>
<?php if ($tab == $this->context->tab): ?>
2014-04-27 14:44:06 +02:00
<li class="selected <?= $tab ?>">
<?php else: ?>
2014-04-27 14:44:06 +02:00
<li class="<?= $tab ?>">
<?php endif ?>
2014-04-30 00:11:13 +02:00
<a href="<?= \Chibi\Router::linkTo(
['IndexController', 'helpAction'],
$tab == $firstTab ? [] : ['tab' => $tab]) ?>">
2014-04-27 14:44:06 +02:00
<?= $text ?>
</a>
</li>
<?php endforeach ?>
</ul>
</nav>
2014-02-16 11:44:42 +01:00
<div class="tab-content">
2013-11-21 15:16:27 +01:00
<?php endif ?>
2014-04-27 14:44:06 +02:00
<?= TextHelper::parseMarkdown(file_get_contents($this->context->path)) ?>
2014-02-16 11:44:42 +01:00
<?php if ($showTabs): ?>
</div>
<?php endif ?>