2017-04-17 12:45:29 -04:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient;
|
|
|
|
|
|
|
|
$whose = $config->get('whose_list') . "'s ";
|
|
|
|
$lastSegment = $urlGenerator->lastSegment();
|
|
|
|
$extraSegment = $lastSegment === 'list' ? '/list' : '';
|
2020-04-22 11:39:44 -04:00
|
|
|
$hasAnime = stripos($_SERVER['REQUEST_URI'], 'anime') !== FALSE;
|
|
|
|
$hasManga = stripos($_SERVER['REQUEST_URI'], 'manga') !== FALSE;
|
2017-04-17 12:45:29 -04:00
|
|
|
|
|
|
|
?>
|
2018-08-10 20:09:28 -04:00
|
|
|
<div id="main-nav" class="flex flex-align-end flex-wrap">
|
2016-07-27 14:32:37 -04:00
|
|
|
<span class="flex-no-wrap grow-1">
|
|
|
|
<?php if(strpos($route_path, 'collection') === FALSE): ?>
|
2017-04-17 14:49:33 -04:00
|
|
|
<?= $helper->a(
|
|
|
|
$urlGenerator->defaultUrl($url_type),
|
2020-05-18 12:53:00 -04:00
|
|
|
$whose . ucfirst($url_type) . ' List',
|
|
|
|
['aria-current'=> 'page']
|
2017-04-17 14:49:33 -04:00
|
|
|
) ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php if($config->get("show_{$url_type}_collection")): ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
[<?= $helper->a(
|
2017-09-14 15:32:53 -04:00
|
|
|
$url->generate("{$url_type}.collection.view") . $extraSegment,
|
2017-04-17 12:45:29 -04:00
|
|
|
ucfirst($url_type) . ' Collection'
|
|
|
|
) ?>]
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php endif ?>
|
2017-09-14 15:32:53 -04:00
|
|
|
<?php if($config->get("show_{$other_type}_collection")): ?>
|
|
|
|
[<?= $helper->a(
|
|
|
|
$url->generate("{$other_type}.collection.view") . $extraSegment,
|
|
|
|
ucfirst($other_type) . ' Collection'
|
|
|
|
) ?>]
|
|
|
|
<?php endif ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
[<?= $helper->a(
|
|
|
|
$urlGenerator->defaultUrl($other_type) . $extraSegment,
|
|
|
|
ucfirst($other_type) . ' List'
|
|
|
|
) ?>]
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php else: ?>
|
2020-04-28 12:04:42 -04:00
|
|
|
<?= $helper->a(
|
|
|
|
$url->generate("{$url_type}.collection.view") . $extraSegment,
|
2020-05-18 12:53:00 -04:00
|
|
|
$whose . ucfirst($url_type) . ' Collection',
|
|
|
|
['aria-current'=> 'page']
|
2020-04-28 12:04:42 -04:00
|
|
|
) ?>
|
2017-09-14 16:18:13 -04:00
|
|
|
<?php if($config->get("show_{$other_type}_collection")): ?>
|
|
|
|
[<?= $helper->a(
|
|
|
|
$url->generate("{$other_type}.collection.view") . $extraSegment,
|
|
|
|
ucfirst($other_type) . ' Collection'
|
|
|
|
) ?>]
|
|
|
|
<?php endif ?>
|
2017-04-17 14:49:33 -04:00
|
|
|
[<?= $helper->a($urlGenerator->defaultUrl('anime') . $extraSegment, 'Anime List') ?>]
|
|
|
|
[<?= $helper->a($urlGenerator->defaultUrl('manga') . $extraSegment, 'Manga List') ?>]
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php endif ?>
|
2018-10-09 18:10:20 -04:00
|
|
|
<?php if ($auth->isAuthenticated() && $config->get(['cache', 'driver']) !== 'null'): ?>
|
2018-09-20 10:41:28 -04:00
|
|
|
<span class="flex-no-wrap small-font">
|
|
|
|
<button type="button" class="js-clear-cache user-btn">Clear API Cache</button>
|
|
|
|
</span>
|
|
|
|
<?php endif ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
</span>
|
2017-04-17 12:45:29 -04:00
|
|
|
|
|
|
|
<span class="flex-no-wrap small-font">[<?= $helper->a(
|
2018-11-01 22:01:09 -04:00
|
|
|
$url->generate('default_user_info'),
|
2017-04-17 12:45:29 -04:00
|
|
|
'About '. $config->get('whose_list')
|
|
|
|
) ?>]</span>
|
|
|
|
|
2017-02-15 16:30:14 -05:00
|
|
|
<?php if ($auth->isAuthenticated()): ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<span class="flex-no-wrap small-font">
|
2018-09-20 10:41:28 -04:00
|
|
|
<?= $helper->a(
|
|
|
|
$url->generate('settings'),
|
|
|
|
'Settings',
|
|
|
|
['class' => 'bracketed']
|
|
|
|
) ?>
|
|
|
|
</span>
|
|
|
|
<span class="flex-no-wrap small-font">
|
|
|
|
<?= $helper->a(
|
|
|
|
$url->generate('logout'),
|
|
|
|
'Logout',
|
|
|
|
['class' => 'bracketed']
|
|
|
|
) ?>
|
|
|
|
</span>
|
|
|
|
<?php else: ?>
|
|
|
|
<span class="flex-no-wrap small-font">
|
|
|
|
[<?= $helper->a($url->generate('login'), "{$whose} Login") ?>]
|
2017-04-17 12:45:29 -04:00
|
|
|
</span>
|
2017-01-16 11:26:19 -05:00
|
|
|
<?php endif ?>
|
2018-08-10 20:09:28 -04:00
|
|
|
</div>
|
2020-05-18 12:53:00 -04:00
|
|
|
<?php if ($container->get('util')->isViewPage() && ($hasAnime || $hasManga)): ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<nav>
|
|
|
|
<?= $helper->menu($menu_name) ?>
|
2020-04-22 11:39:44 -04:00
|
|
|
<?php if (stripos($_SERVER['REQUEST_URI'], 'history') === FALSE): ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<br />
|
|
|
|
<ul>
|
2020-05-18 12:53:00 -04:00
|
|
|
<?php $currentView = Util::eq('list', $lastSegment) ? 'list' : 'cover' ?>
|
|
|
|
<li class="<?= Util::isNotSelected('list', $lastSegment) ?>">
|
|
|
|
<a aria-current="<?= Util::ariaCurrent($currentView === 'cover') ?>"
|
|
|
|
href="<?= $urlGenerator->url($route_path) ?>">Cover View</a>
|
|
|
|
</li>
|
|
|
|
<li class="<?= Util::isSelected('list', $lastSegment) ?>">
|
|
|
|
<a aria-current="<?= Util::ariaCurrent($currentView === 'list') ?>"
|
|
|
|
href="<?= $urlGenerator->url("{$route_path}/list") ?>">List View</a>
|
|
|
|
</li>
|
2016-07-27 14:32:37 -04:00
|
|
|
</ul>
|
2020-04-22 11:39:44 -04:00
|
|
|
<?php endif ?>
|
2017-01-10 12:35:46 -05:00
|
|
|
</nav>
|
2020-05-18 12:53:00 -04:00
|
|
|
<?php endif ?>
|