2020-07-27 09:35:34 +00:00
|
|
|
<?php
|
|
|
|
$navigation = [
|
2020-08-12 20:03:45 +00:00
|
|
|
'dashboard' => ['icon' => 'dashboard', 'items' => ['admin']],
|
2020-07-27 09:35:34 +00:00
|
|
|
'podcasts' => [
|
|
|
|
'icon' => 'mic',
|
2020-08-18 16:31:28 +00:00
|
|
|
'items' => ['podcast-list', 'podcast-create'],
|
2020-07-27 09:35:34 +00:00
|
|
|
],
|
2020-08-14 18:27:57 +00:00
|
|
|
'users' => ['icon' => 'group', 'items' => ['user-list', 'user-create']],
|
2020-08-18 16:31:28 +00:00
|
|
|
'pages' => ['icon' => 'pages', 'items' => ['page-list', 'page-create']],
|
2020-07-27 09:35:34 +00:00
|
|
|
]; ?>
|
|
|
|
|
|
|
|
<nav class="<?= $class ?>">
|
|
|
|
<?php foreach ($navigation as $section => $data): ?>
|
|
|
|
<div class="mb-4">
|
2020-08-05 16:10:39 +00:00
|
|
|
<button class="inline-flex items-center w-full px-6 py-1 outline-none focus:shadow-outline" type="button">
|
2020-07-27 09:35:34 +00:00
|
|
|
<?= icon($data['icon'], 'text-gray-500') ?>
|
|
|
|
<span class="ml-2"><?= lang('AdminNavigation.' . $section) ?></span>
|
|
|
|
</button>
|
|
|
|
<ul>
|
|
|
|
<?php foreach ($data['items'] as $item): ?>
|
2020-08-04 11:25:22 +00:00
|
|
|
<?php $isActive = base_url(route_to($item)) == current_url(); ?>
|
2020-07-27 09:35:34 +00:00
|
|
|
<li>
|
2020-08-14 18:27:57 +00:00
|
|
|
<a class="block py-1 pl-12 pr-2 text-sm text-gray-600 outline-none hover:text-gray-900 focus:shadow-outline <?= $isActive
|
2020-07-27 09:35:34 +00:00
|
|
|
? 'font-semibold text-gray-900'
|
|
|
|
: '' ?>" href="<?= route_to($item) ?>"><?= lang(
|
|
|
|
'AdminNavigation.' . $item
|
|
|
|
) ?></a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
|
|
<a href="<?= route_to(
|
|
|
|
'home'
|
|
|
|
) ?>" class="inline-flex items-center px-4 py-1 mt-auto text-sm underline outline-none hover:no-underline focus:shadow-outline">
|
|
|
|
<?= lang('AdminNavigation.go_to_website') ?>
|
|
|
|
<?= icon('external-link', 'ml-2 text-gray-500') ?>
|
|
|
|
</a>
|
|
|
|
</nav>
|