mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
49 lines
3.2 KiB
PHP
49 lines
3.2 KiB
PHP
<!DOCTYPE html>
|
||
<html lang="fr">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title><?= htmlspecialchars($pageTitle ?? 'Admin') ?> – Posterg</title>
|
||
<link rel="icon" type="image/svg+xml" href="/assets/admin_favicon.svg">
|
||
<link rel="stylesheet" href="/assets/css/modern-normalize.min.css">
|
||
<link rel="stylesheet" href="/assets/css/admin.css">
|
||
<?php foreach ($extraCss ?? [] as $css): ?>
|
||
<link rel="stylesheet" href="<?= htmlspecialchars($css) ?>">
|
||
<?php endforeach; ?>
|
||
<?php if (php_sapi_name() === 'cli-server'): ?>
|
||
<script>
|
||
(function poll(){
|
||
fetch('/live-reload.php').then(r=>r.json()).then(d=>{
|
||
if(d.changed) location.reload(); else setTimeout(poll,1000);
|
||
}).catch(()=>setTimeout(poll,2000));
|
||
})();
|
||
</script>
|
||
<?php endif; ?>
|
||
</head>
|
||
<body class="admin-body">
|
||
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
|
||
<nav class="admin-nav" aria-label="Navigation admin">
|
||
<a href="/" class="admin-nav__logo" target="_blank" rel="noopener noreferrer">
|
||
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 256 256" style="vertical-align:middle;margin-right:0.4em"><path d="M208,72H128V32a8,8,0,0,0-13.66-5.66l-96,96a8,8,0,0,0,0,11.32l96,96A8,8,0,0,0,128,224V184h80a16,16,0,0,0,16-16V88A16,16,0,0,0,208,72Zm0,96H120a8,8,0,0,0-8,8v28.69L35.31,128,112,51.31V80a8,8,0,0,0,8,8h88Z"></path></svg>Posterg<span class="sr-only"> (site public, nouvel onglet)</span>
|
||
</a>
|
||
<?php
|
||
$currentPage = basename($_SERVER['PHP_SELF']);
|
||
$thesisId = $_GET['id'] ?? null;
|
||
?>
|
||
<ul class="admin-nav__list">
|
||
<li><a href="/admin/" <?= $currentPage === 'index.php' ? 'aria-current="page"' : '' ?>>Liste des TFE</a></li>
|
||
<li><a href="/admin/add.php" <?= $currentPage === 'add.php' ? 'aria-current="page"' : '' ?>>Ajouter un TFE</a></li>
|
||
<li><a href="/admin/import.php" <?= $currentPage === 'import.php' ? 'aria-current="page"' : '' ?>>Importer une liste de TFE</a></li>
|
||
<li><a href="/admin/pages.php" <?= in_array($currentPage, ['pages.php','pages-edit.php']) ? 'aria-current="page"' : '' ?>>Pages statiques</a></li>
|
||
<li><a href="/admin/tags.php" <?= $currentPage === 'tags.php' ? 'aria-current="page"' : '' ?>>Mots-clés</a></li>
|
||
<li><a href="/admin/system.php" <?= in_array($currentPage, ['system.php','status.php','logs.php']) ? 'aria-current="page"' : '' ?>>Système</a></li>
|
||
<li><a href="/admin/account.php" <?= $currentPage === 'account.php' ? 'aria-current="page"' : '' ?>>Compte</a></li>
|
||
<?php if ($thesisId && in_array($currentPage, ['edit.php', 'thanks.php'])): ?>
|
||
<li><a href="/admin/edit.php?id=<?= intval($thesisId) ?>" <?= $currentPage === 'edit.php' ? 'aria-current="page"' : '' ?>>Modifier</a></li>
|
||
<?php endif; ?>
|
||
<?php if (defined('ADMIN_PASSWORD_HASH')): ?>
|
||
<li class="admin-nav__logout"><a href="/admin/logout.php">Déconnexion</a></li>
|
||
<?php endif; ?>
|
||
</ul>
|
||
</nav>
|