cleanup modal: list stale files to remove; storage restructure: documents/ → {objet}/

This commit is contained in:
Pontoporeia
2026-05-19 22:00:10 +02:00
parent c6199525f9
commit defc919cd0
19 changed files with 292 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
<?php
/**
* File browser fragment — returns a clickable directory tree of documents/ + theses/.
* File browser fragment — returns a clickable directory tree of tfe/ these/ frart/ documents/ + theses/.
*
* GET /admin/fragments/file-browser.php?dir=documents/2025
*
@@ -17,7 +17,7 @@ error_log('[file-browser] ENTRY | dir=' . ($_GET['dir'] ?? '(root)') . ' | stora
// Determine which directory to browse
$relDir = trim($_GET['dir'] ?? '', '/');
if ($relDir !== '' && !preg_match('#^(documents|theses)(/|$)#', $relDir)) {
if ($relDir !== '' && !preg_match('#^(tfe|these|frart|documents|theses)(/|$)#', $relDir)) {
$relDir = '';
}
@@ -84,7 +84,7 @@ if ($relDir !== '') {
$parentDir = implode('/', $parentParts);
}
$rootDirs = ['documents', 'theses'];
$rootDirs = ['tfe', 'these', 'frart', 'documents', 'theses'];
// SVG icon for a given extension
function fileIcon(string $ext): string {