mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 08:09:18 +02:00
- Remove overtype-webcomponent.min.js (zero references) - Extract copyLogContent + fallbackCopy + HTMX tab-updater → app/admin-logs.js (removes duplicate from both system.php and parametres.php) - Extract copyUrl → app/clipboard.js (shared by acces.php) - Extract tag/language pill-search logic → app/pill-search.js Generalized with data-pill-search attributes, auto-inits via DOMContentLoaded + htmx:afterSwap - Extract access-request form handler → app/access-request.js (was inline in templates/public/tfe.php) Files created: admin-logs.js, clipboard.js, pill-search.js, access-request.js Files modified: 9 templates/controllers to drop inline scripts and reference external JS files
39 lines
1.7 KiB
PHP
39 lines
1.7 KiB
PHP
<?php
|
|
require_once __DIR__ . '/../../bootstrap.php';
|
|
require_once __DIR__ . '/../../src/AdminAuth.php';
|
|
require_once __DIR__ . '/../../src/ShareLink.php';
|
|
require_once APP_ROOT . '/src/EmailObfuscator.php';
|
|
|
|
App::adminGuard();
|
|
|
|
// ── Liens d'accès étudiant·e ──────────────────────────────────────────────────
|
|
$shareLink = ShareLink::make();
|
|
$links = $shareLink->listActive();
|
|
$archivedLinks = $shareLink->listArchived();
|
|
|
|
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
|
$baseUrl = $protocol . '://' . ($_SERVER['HTTP_HOST'] ?? 'localhost');
|
|
|
|
// ── Demandes d'accès aux fichiers ─────────────────────────────────────────────
|
|
require_once APP_ROOT . '/src/Database.php';
|
|
require_once APP_ROOT . '/src/Controllers/FileAccessController.php';
|
|
|
|
$db = new Database();
|
|
$siteSettings = $db->getAllSettings();
|
|
|
|
$controller = FileAccessController::create();
|
|
$vars = $controller->handle();
|
|
extract($vars);
|
|
|
|
// ── Page setup ────────────────────────────────────────────────────────────────
|
|
$pageTitle = 'Accès';
|
|
$isAdmin = true;
|
|
$bodyClass = 'admin-body';
|
|
$extraJs = ['/assets/js/app/clipboard.js'];
|
|
|
|
require_once APP_ROOT . '/templates/head.php';
|
|
echo '<link rel="stylesheet" href="/assets/css/file-access.css">';
|
|
include APP_ROOT . '/templates/header.php';
|
|
include APP_ROOT . '/templates/admin/acces.php';
|
|
require_once APP_ROOT . '/templates/admin/footer.php';
|