mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
feat: admin tag management, maintenance mode, TFE visibility states
Tags admin: - Database: getAllTagsWithCount(), renameTag(), mergeTag(), deleteTag() - public/admin/tags.php: table with inline rename/merge/delete forms, CSRF-guarded - public/admin/actions/tag.php: routes on action=rename|merge|delete - templates/admin/head.php: 'Mots-clés' nav link - admin.css: admin-inline-form, admin-btn--sm/warning/danger variants Maintenance mode: - config/bootstrap.php: gate on MAINTENANCE_FLAG file; admin/ and maintenance.php exempt - public/maintenance.php: 503 dark minimal page - public/admin/actions/maintenance.php: enable/disable toggle - public/admin/index.php: status bar with toggle button - admin.css: admin-maintenance-bar styles TFE Visibility (Libre/Interne/Interdit via existing access_type_id): - migration 002_add_visibility.sql: seeds access_types if missing - Database: setVisibility(), bulkSetVisibility(), getAccessTypes() - public/media.php: blocks thesis files for access_type_id=3 - public/tfe.php: shows access_type, context_note; hides file panel for Interdit - public/admin/edit.php: access_type_id select + context_note textarea; saves both - public/admin/index.php: three-state badge (Libre/Interne/Interdit) per row - public/admin/actions/visibility.php: single + bulk visibility action handler - admin.css: status-access badge variants
This commit is contained in:
@@ -128,6 +128,13 @@ $currentNav = '';
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($data['access_type'])): ?>
|
||||
<div class="tfe-meta-item">
|
||||
<span class="label">Accès :</span>
|
||||
<span class="value"><?= htmlspecialchars($data['access_type']) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($data['license_type'])): ?>
|
||||
<div class="tfe-meta-item">
|
||||
<span class="label">Licence :</span>
|
||||
@@ -135,6 +142,13 @@ $currentNav = '';
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($data['context_note'])): ?>
|
||||
<div class="tfe-meta-item" style="align-items:start;">
|
||||
<span class="label">Note :</span>
|
||||
<span class="value" style="font-style:italic;"><?= nl2br(htmlspecialchars($data['context_note'])) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($data['baiu_link'])): ?>
|
||||
<div class="tfe-meta-item">
|
||||
<span class="label">Contact :</span>
|
||||
@@ -162,7 +176,24 @@ $currentNav = '';
|
||||
|
||||
<!-- RIGHT: media -->
|
||||
<div class="tfe-right">
|
||||
<?php if (!empty($data['files'])): ?>
|
||||
<?php
|
||||
// Determine effective access: need raw access_type_id
|
||||
// The view exposes 'access_type' (name string). Fetch raw id for gate.
|
||||
$accessTypeId = null;
|
||||
try {
|
||||
$accessStmt = $db->getConnection()->prepare(
|
||||
"SELECT access_type_id FROM theses WHERE id = ?"
|
||||
);
|
||||
$accessStmt->execute([$thesisId]);
|
||||
$accessTypeId = (int)($accessStmt->fetchColumn() ?? 1);
|
||||
} catch (\Throwable $e) {}
|
||||
$isInterdit = ($accessTypeId === 3);
|
||||
?>
|
||||
<?php if ($isInterdit): ?>
|
||||
<p class="tfe-no-files" style="color:#999;font-style:italic;">
|
||||
Ce TFE n'est pas disponible en ligne.
|
||||
</p>
|
||||
<?php elseif (!empty($data['files'])): ?>
|
||||
<?php foreach ($data['files'] as $file): ?>
|
||||
<?php $ext = strtolower(pathinfo($file['file_path'], PATHINFO_EXTENSION)); ?>
|
||||
<div class="tfe-media-block">
|
||||
@@ -184,7 +215,7 @@ $currentNav = '';
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p class="tfe-no-files">Aucun fichier disponible pour ce TFE.</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; // end !$isInterdit ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user