69 lines
2.8 KiB
PHP
Executable File
69 lines
2.8 KiB
PHP
Executable File
<?php
|
|
// views/layouts/header.php
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?= e($page_title ?? 'Web Writer') ?></title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1.5.10/css/pico.min.css">
|
|
<link rel="stylesheet" href="<?= SITE_URL ?>/assets/css/style.css">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.6/tinymce.min.js" referrerpolicy="origin"></script>
|
|
</head>
|
|
<body>
|
|
<nav class="container-fluid">
|
|
<ul>
|
|
<li><strong><a href="<?= SITE_URL ?>/"><?= e(APP_NAME) ?></a></strong></li>
|
|
</ul>
|
|
<ul>
|
|
<?php if (is_logged_in()): ?>
|
|
<li><a href="<?= SITE_URL ?>/dashboard">📊 Панель управления</a></li>
|
|
<li><a href="<?= SITE_URL ?>/books">📚 Мои книги</a></li>
|
|
<li><a href="<?= SITE_URL ?>/series">📑 Серии</a></li>
|
|
<li>
|
|
<details role="list" dir="rtl">
|
|
<summary aria-haspopup="listbox" role="link">
|
|
👤 <?= e($_SESSION['display_name']) ?>
|
|
</summary>
|
|
<ul role="listbox">
|
|
<li><a href="<?= SITE_URL ?>/profile">⚙️ Профиль</a></li>
|
|
<li><a href="<?= SITE_URL ?>/logout">🚪 Выход</a></li>
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<?php else: ?>
|
|
<li><a href="<?= SITE_URL ?>/login">🔑 Вход</a></li>
|
|
<li><a href="<?= SITE_URL ?>/register">📝 Регистрация</a></li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
</nav>
|
|
|
|
<main class="container">
|
|
<?php if (isset($_SESSION['success'])): ?>
|
|
<div class="alert alert-success">
|
|
<?= e($_SESSION['success']) ?>
|
|
<?php unset($_SESSION['success']); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_SESSION['error'])): ?>
|
|
<div class="alert alert-error">
|
|
<?= e($_SESSION['error']) ?>
|
|
<?php unset($_SESSION['error']); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_SESSION['warning'])): ?>
|
|
<div class="alert alert-warning">
|
|
<?= e($_SESSION['warning']) ?>
|
|
<?php unset($_SESSION['warning']); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_SESSION['info'])): ?>
|
|
<div class="alert alert-info">
|
|
<?= e($_SESSION['info']) ?>
|
|
<?php unset($_SESSION['info']); ?>
|
|
</div>
|
|
<?php endif; ?>
|