fix: TFE and annexes files not saved, plus keyword validation and file preview CSS

- ThesisCreateController::submit() was missing call to handleAnnexeFiles
- ThesisEditController::save() was missing annexe upload handling
- handleAnnexeFiles now applies ALLOWED_MIME_TYPES/ALLOWED_EXTENSIONS validation
  (same restrictions as TFE files, formerly only size was checked)
- Use correct $_FILES key 'annexes' (matching the form input name)
- Relax keyword minimum: admin create/edit require 1+, student (partage) requires 3
- Add CSS styles for file preview items (.fp-item, .fp-thumb, .fp-icon,
  .fp-meta, .fp-name, .fp-size) so multi-file previews (annexes, etc.) wrap correctly
- Fix TFE file input accept attribute in fichiers-fragment.php to include
  video/audio/archive extensions
This commit is contained in:
Pontoporeia
2026-05-10 15:14:25 +02:00
parent 38dc8de9d8
commit a1a5d4609f
7 changed files with 102 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ $hasAnnexesChecked = !empty($_POST['has_annexes']);
<div class="admin-file-input">
<input type="file" id="tfe-files-input"
name="files[]" multiple
accept=".pdf,.jpg,.jpeg,.png,.gif,.webp"
accept=".pdf,.jpg,.jpeg,.png,.gif,.webp,.mp4,.webm,.ogv,.mov,.mp3,.ogg,.oga,.wav,.flac,.aac,.m4a,.vtt,.zip,.tar,.gz,.tgz"
class="tfe-file-picker">
<small class="admin-file-hint">
PDF (max 100 MB) · Images (JPG/PNG/GIF/WEBP).