2024-12-30 20:17:45 +01:00
|
|
|
|
<?php
|
|
|
|
|
require_once 'fonctions.php';
|
|
|
|
|
|
|
|
|
|
session_start();
|
|
|
|
|
if (!isset($_SESSION['admin_id'])) {
|
2024-12-30 23:41:42 +01:00
|
|
|
|
header('Location: admin.php?action=login');
|
|
|
|
|
exit;
|
2024-12-30 20:17:45 +01:00
|
|
|
|
}
|
2025-01-06 23:53:46 +01:00
|
|
|
|
checkAdminSession();
|
2024-12-30 20:17:45 +01:00
|
|
|
|
|
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
2024-12-30 23:41:42 +01:00
|
|
|
|
$action = $_POST['action'] ?? '';
|
|
|
|
|
$path = $_POST['path'] ?? '';
|
|
|
|
|
$newName = $_POST['new_name'] ?? '';
|
|
|
|
|
$description = $_POST['description'] ?? '';
|
|
|
|
|
$matureContent = isset($_POST['mature_content']) ? '18+' : '18-';
|
|
|
|
|
|
|
|
|
|
switch ($action) {
|
|
|
|
|
case 'create_folder':
|
|
|
|
|
if ($path && $newName) {
|
|
|
|
|
$newPath = $path . '/' . sanitizeFilename($newName);
|
|
|
|
|
if (!file_exists($newPath)) {
|
2025-01-03 14:33:31 +01:00
|
|
|
|
$moreInfoUrl = $_POST['more_info_url'] ?? '';
|
2025-01-09 18:48:03 +01:00
|
|
|
|
mkdir($newPath, 0775, true);
|
2025-01-03 14:33:31 +01:00
|
|
|
|
$infoContent = $newName . "\n" . $description . "\n" . $matureContent . "\n" . $moreInfoUrl;
|
2024-12-30 23:41:42 +01:00
|
|
|
|
file_put_contents($newPath . '/infos.txt', $infoContent);
|
|
|
|
|
$_SESSION['success_message'] = "Dossier créé avec succès.";
|
|
|
|
|
} else {
|
|
|
|
|
$_SESSION['error_message'] = "Ce dossier existe déjà.";
|
|
|
|
|
}
|
2025-01-09 13:01:53 +01:00
|
|
|
|
logAdminAction(
|
|
|
|
|
$_SESSION['admin_id'],
|
|
|
|
|
'CREATE_FOLDER',
|
|
|
|
|
"Création du dossier : " . $newName,
|
|
|
|
|
$newPath
|
|
|
|
|
);
|
2024-12-30 23:41:42 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
2025-01-03 14:33:31 +01:00
|
|
|
|
|
2024-12-30 23:41:42 +01:00
|
|
|
|
case 'edit_folder':
|
|
|
|
|
if ($path && isSecurePath($path)) {
|
2025-01-03 14:33:31 +01:00
|
|
|
|
$moreInfoUrl = $_POST['more_info_url'] ?? '';
|
|
|
|
|
$infoContent = $newName . "\n" . $description . "\n" . $matureContent . "\n" . $moreInfoUrl;
|
2024-12-30 23:41:42 +01:00
|
|
|
|
$infoPath = $path . '/infos.txt';
|
|
|
|
|
if (file_put_contents($infoPath, $infoContent) !== false) {
|
|
|
|
|
$_SESSION['success_message'] = "Dossier modifié avec succès.";
|
|
|
|
|
} else {
|
|
|
|
|
$_SESSION['error_message'] = "Erreur lors de la modification du dossier.";
|
|
|
|
|
}
|
2025-01-09 13:01:53 +01:00
|
|
|
|
logAdminAction(
|
|
|
|
|
$_SESSION['admin_id'],
|
|
|
|
|
'EDIT_FOLDER',
|
|
|
|
|
"Modification du dossier : " . $newName,
|
|
|
|
|
$path
|
|
|
|
|
);
|
2024-12-30 23:41:42 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'delete_folder':
|
|
|
|
|
if ($path && isSecurePath($path) && $path !== './liste_albums') {
|
|
|
|
|
function rrmdir($dir) {
|
|
|
|
|
if (is_dir($dir)) {
|
|
|
|
|
$objects = scandir($dir);
|
|
|
|
|
foreach ($objects as $object) {
|
|
|
|
|
if ($object != "." && $object != "..") {
|
|
|
|
|
if (is_dir($dir . "/" . $object)) {
|
|
|
|
|
rrmdir($dir . "/" . $object);
|
|
|
|
|
} else {
|
|
|
|
|
unlink($dir . "/" . $object);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
rmdir($dir);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-09 13:01:53 +01:00
|
|
|
|
logAdminAction(
|
|
|
|
|
$_SESSION['admin_id'],
|
|
|
|
|
'DELETE_FOLDER',
|
|
|
|
|
"Suppression du dossier",
|
|
|
|
|
$path
|
|
|
|
|
);
|
2024-12-30 23:41:42 +01:00
|
|
|
|
rrmdir($path);
|
|
|
|
|
$_SESSION['success_message'] = "Dossier supprimé avec succès.";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
header('Location: arbre.php');
|
|
|
|
|
exit;
|
2024-12-30 20:17:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$currentPath = isset($_GET['path']) ? $_GET['path'] : './liste_albums';
|
|
|
|
|
$currentPath = realpath($currentPath);
|
|
|
|
|
|
|
|
|
|
if (!isSecurePath($currentPath)) {
|
2024-12-30 23:41:42 +01:00
|
|
|
|
header('Location: arbre.php');
|
|
|
|
|
exit;
|
2024-12-30 20:17:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function generateTree($path, $currentPath) {
|
2024-12-30 22:36:47 +01:00
|
|
|
|
if (!is_dir($path)) return '';
|
|
|
|
|
|
|
|
|
|
$output = '<ul class="tree-list">';
|
|
|
|
|
|
|
|
|
|
// Si c'est le dossier racine, ajoutons-le à l'arborescence
|
|
|
|
|
if ($path === './liste_albums') {
|
2025-01-03 00:19:11 +01:00
|
|
|
|
$carouselPath = './img_carrousel';
|
|
|
|
|
if (is_dir($carouselPath)) {
|
|
|
|
|
$output .= '<li class="tree-item carousel-folder' . ($carouselPath === $currentPath ? ' active' : '') . '">';
|
|
|
|
|
$output .= '<div class="tree-item-content">';
|
|
|
|
|
$output .= '<span class="tree-link">';
|
|
|
|
|
$output .= '<span class="folder-icon">🎞️</span> Images du carrousel';
|
|
|
|
|
$output .= '</span>';
|
|
|
|
|
$output .= '<div class="tree-actions">';
|
|
|
|
|
$output .= '<a href="arbre-img.php?path=' . urlencode($carouselPath) . '" class="tree-button carousel-button" title="Gérer les images">🖼️</a>';
|
|
|
|
|
$output .= '</div></div></li>';
|
|
|
|
|
}
|
2024-12-30 22:36:47 +01:00
|
|
|
|
$info = getAlbumInfo($path);
|
|
|
|
|
$output .= '<li class="tree-item root-folder' . ($path === $currentPath ? ' active' : '') . '">';
|
|
|
|
|
$output .= '<div class="tree-item-content">';
|
|
|
|
|
$output .= '<span class="tree-link">';
|
|
|
|
|
$output .= '<span class="folder-icon">📁</span> ' . htmlspecialchars($info['title']);
|
2024-12-30 23:41:42 +01:00
|
|
|
|
if ($info['mature_content']) {
|
|
|
|
|
$output .= ' <span class="mature-warning">🔞</span>';
|
|
|
|
|
}
|
2024-12-30 22:36:47 +01:00
|
|
|
|
$output .= '</span>';
|
|
|
|
|
$output .= '<div class="tree-actions">';
|
2025-01-06 18:59:53 +01:00
|
|
|
|
$output .= '<button onclick="editFolder(\'' . htmlspecialchars($path) . '\', \'' . rawurlencode($info['title']) . '\', \'' . rawurlencode($info['description']) . '\', ' . ($info['mature_content'] ? 'true' : 'false') . ', \'' . rawurlencode($info['more_info_url']) . '\', ' . (hasImages($path) ? 'true' : 'false') . ')" class="tree-button">✏️</button>';
|
2024-12-30 22:36:47 +01:00
|
|
|
|
$output .= '<button onclick="createSubfolder(\'' . htmlspecialchars($path) . '\')" class="tree-button">➕</button>';
|
|
|
|
|
$output .= '</div></div>';
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-07 15:30:48 +01:00
|
|
|
|
// Récupérer et trier les sous-dossiers
|
|
|
|
|
$dirs = array();
|
2024-12-30 22:36:47 +01:00
|
|
|
|
foreach (new DirectoryIterator($path) as $item) {
|
|
|
|
|
if ($item->isDot()) continue;
|
|
|
|
|
if ($item->isDir()) {
|
|
|
|
|
$fullPath = $item->getPathname();
|
|
|
|
|
$info = getAlbumInfo($fullPath);
|
2025-01-07 15:30:48 +01:00
|
|
|
|
$dirs[$info['title']] = $fullPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tri alphabétique par titre
|
|
|
|
|
ksort($dirs, SORT_STRING | SORT_FLAG_CASE);
|
|
|
|
|
|
|
|
|
|
// Parcourir les dossiers triés
|
|
|
|
|
foreach ($dirs as $title => $fullPath) {
|
|
|
|
|
$info = getAlbumInfo($fullPath);
|
|
|
|
|
$isCurrentPath = realpath($fullPath) === $currentPath;
|
|
|
|
|
$hasSubfolders = hasSubfolders($fullPath);
|
|
|
|
|
|
|
|
|
|
$output .= '<li class="tree-item' . ($isCurrentPath ? ' active' : '') . '">';
|
|
|
|
|
$output .= '<div class="tree-item-content">';
|
|
|
|
|
$output .= '<span class="tree-link">';
|
|
|
|
|
$output .= '<span class="folder-icon">📁</span> ' . htmlspecialchars($info['title']);
|
|
|
|
|
if ($info['mature_content']) {
|
|
|
|
|
$output .= ' <span class="mature-warning">🔞</span>';
|
|
|
|
|
}
|
|
|
|
|
$output .= '</span>';
|
|
|
|
|
$output .= '<div class="tree-actions">';
|
|
|
|
|
if (!$hasSubfolders) {
|
|
|
|
|
$output .= '<a href="arbre-img.php?path=' . urlencode($fullPath) . '" class="tree-button" style="text-decoration: none">🖼️</a>';
|
|
|
|
|
}
|
|
|
|
|
if (!$hasSubfolders) {
|
|
|
|
|
$output .= '<button onclick="editFolder(\'' . htmlspecialchars($fullPath) . '\', \''
|
|
|
|
|
. rawurlencode($info['title']) . '\', \''
|
|
|
|
|
. rawurlencode($info['description']) . '\', '
|
|
|
|
|
. ($info['mature_content'] ? 'true' : 'false') . ', \''
|
|
|
|
|
. rawurlencode($info['more_info_url']) . '\', '
|
|
|
|
|
. (hasImages($fullPath) ? 'true' : 'false')
|
|
|
|
|
. ')" class="tree-button">✏️</button>';
|
|
|
|
|
} else {
|
|
|
|
|
$output .= '<button onclick="editFolder(\'' . htmlspecialchars($fullPath) . '\', \''
|
|
|
|
|
. rawurlencode($info['title']) . '\', \''
|
|
|
|
|
. rawurlencode($info['description']) . '\', '
|
|
|
|
|
. ($info['mature_content'] ? 'true' : 'false') . ', \'\', false)" class="tree-button">✏️</button>';
|
|
|
|
|
}
|
|
|
|
|
if (!hasImages($fullPath)) {
|
|
|
|
|
$output .= '<button onclick="createSubfolder(\'' . htmlspecialchars($fullPath) . '\')" class="tree-button">➕</button>';
|
2024-12-30 22:36:47 +01:00
|
|
|
|
}
|
2025-01-07 15:30:48 +01:00
|
|
|
|
if ($fullPath !== './liste_albums') {
|
|
|
|
|
$output .= '<button onclick="deleteFolder(\'' . htmlspecialchars($fullPath) . '\')" class="tree-button tree-button-danger">🗑️</button>';
|
|
|
|
|
}
|
|
|
|
|
$output .= '</div></div>';
|
|
|
|
|
|
|
|
|
|
$output .= generateTree($fullPath, $currentPath);
|
|
|
|
|
$output .= '</li>';
|
2024-12-30 22:36:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$output .= '</ul>';
|
|
|
|
|
return $output;
|
2024-12-30 20:17:45 +01:00
|
|
|
|
}
|
2025-01-06 14:06:25 +01:00
|
|
|
|
|
|
|
|
|
$config = getSiteConfig();
|
2024-12-30 20:17:45 +01:00
|
|
|
|
?>
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="fr">
|
|
|
|
|
<head>
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2025-01-06 14:06:25 +01:00
|
|
|
|
<title>Arborescence - <?php echo htmlspecialchars($config['site_title']); ?></title>
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<link rel="icon" type="image/png" href="favicon.png">
|
|
|
|
|
<link rel="stylesheet" href="styles.css">
|
|
|
|
|
<link rel="stylesheet" href="styles-admin.css">
|
2024-12-30 20:17:45 +01:00
|
|
|
|
</head>
|
|
|
|
|
<body class="admin-page">
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<div class="admin-header">
|
|
|
|
|
<h1>Gestion de l'arborescence</h1>
|
|
|
|
|
<div class="admin-actions">
|
|
|
|
|
<button onclick="createSubfolder('./liste_albums')" class="action-button">Nouveau dossier</button>
|
|
|
|
|
<a href="admin.php" class="action-button action-button-secondary">Retour</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-12-30 20:17:45 +01:00
|
|
|
|
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<div class="admin-content">
|
|
|
|
|
<?php if (isset($_SESSION['success_message'])): ?>
|
|
|
|
|
<div class="message success-message"><?php echo htmlspecialchars($_SESSION['success_message']); ?></div>
|
|
|
|
|
<?php unset($_SESSION['success_message']); ?>
|
|
|
|
|
<?php endif; ?>
|
2024-12-30 20:17:45 +01:00
|
|
|
|
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<?php if (isset($_SESSION['error_message'])): ?>
|
|
|
|
|
<div class="message error-message"><?php echo htmlspecialchars($_SESSION['error_message']); ?></div>
|
|
|
|
|
<?php unset($_SESSION['error_message']); ?>
|
|
|
|
|
<?php endif; ?>
|
2024-12-30 20:17:45 +01:00
|
|
|
|
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<div class="tree-container">
|
|
|
|
|
<?php echo generateTree('./liste_albums', $currentPath); ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-12-30 20:17:45 +01:00
|
|
|
|
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<!-- Modal de création de dossier -->
|
|
|
|
|
<div id="createFolderModal" class="modal">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<h2>Créer un nouveau dossier</h2>
|
|
|
|
|
<form method="post" action="arbre.php">
|
|
|
|
|
<input type="hidden" name="action" value="create_folder">
|
|
|
|
|
<input type="hidden" name="path" id="parentPath">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="new_name">Nom du dossier :</label>
|
|
|
|
|
<input type="text" id="new_name" name="new_name" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="description">Description :</label>
|
|
|
|
|
<textarea id="description" name="description" rows="4" class="form-textarea"></textarea>
|
|
|
|
|
</div>
|
2025-01-03 14:33:31 +01:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="more_info_url">Lien "En savoir plus" (optionnel) :</label>
|
|
|
|
|
<input type="url" id="more_info_url" name="more_info_url" placeholder="https://...">
|
|
|
|
|
</div>
|
2024-12-30 23:41:42 +01:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="toggle-label">
|
|
|
|
|
<input type="checkbox" name="mature_content" id="mature_content">
|
|
|
|
|
<span class="toggle-text">Contenu réservé aux plus de 18 ans</span>
|
|
|
|
|
<span class="toggle-warning">⚠️</span>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
2025-01-03 14:33:31 +01:00
|
|
|
|
<div class="form-group" id="create_more_info_url_field" style="display: none;">
|
|
|
|
|
<label for="more_info_url">Lien "En savoir plus" (optionnel) :</label>
|
|
|
|
|
<input type="url" id="more_info_url" name="more_info_url" placeholder="https://...">
|
|
|
|
|
</div>
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<button type="button" onclick="closeModal()" class="action-button action-button-secondary">Annuler</button>
|
|
|
|
|
<button type="submit" class="action-button">Créer</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Modal d'édition de dossier -->
|
|
|
|
|
<div id="editFolderModal" class="modal">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<h2>Modifier le dossier</h2>
|
|
|
|
|
<form method="post" action="arbre.php">
|
|
|
|
|
<input type="hidden" name="action" value="edit_folder">
|
|
|
|
|
<input type="hidden" name="path" id="editPath">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="edit_name">Nom du dossier :</label>
|
|
|
|
|
<input type="text" id="edit_name" name="new_name" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="edit_description">Description :</label>
|
|
|
|
|
<textarea id="edit_description" name="description" rows="4" class="form-textarea"></textarea>
|
|
|
|
|
</div>
|
2024-12-30 23:41:42 +01:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="toggle-label">
|
|
|
|
|
<input type="checkbox" name="mature_content" id="edit_mature_content">
|
|
|
|
|
<span class="toggle-text">Contenu réservé aux plus de 18 ans</span>
|
|
|
|
|
<span class="toggle-warning">⚠️</span>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
2025-01-03 14:33:31 +01:00
|
|
|
|
<div class="form-group" id="edit_more_info_url_field">
|
|
|
|
|
<label for="edit_more_info_url">Lien "En savoir plus" (optionnel) :</label>
|
|
|
|
|
<input type="url" id="edit_more_info_url" name="more_info_url" placeholder="https://...">
|
|
|
|
|
</div>
|
2024-12-30 22:36:47 +01:00
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<button type="button" onclick="closeModal()" class="action-button action-button-secondary">Annuler</button>
|
|
|
|
|
<button type="submit" class="action-button">Enregistrer</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Modal de confirmation de suppression -->
|
|
|
|
|
<div id="deleteFolderModal" class="modal">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<h2>Confirmer la suppression</h2>
|
|
|
|
|
<p>Êtes-vous sûr de vouloir supprimer ce dossier et tout son contenu ?</p>
|
|
|
|
|
<form method="post" action="arbre.php">
|
|
|
|
|
<input type="hidden" name="action" value="delete_folder">
|
|
|
|
|
<input type="hidden" name="path" id="deletePath">
|
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<button type="button" onclick="closeModal()" class="action-button action-button-secondary">Annuler</button>
|
|
|
|
|
<button type="submit" class="action-button action-button-danger">Supprimer</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
function createSubfolder(path) {
|
|
|
|
|
document.getElementById('parentPath').value = path;
|
2025-01-03 14:33:31 +01:00
|
|
|
|
document.getElementById('create_more_info_url_field').style.display = 'none';
|
2024-12-30 22:36:47 +01:00
|
|
|
|
document.getElementById('createFolderModal').style.display = 'block';
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-03 14:33:31 +01:00
|
|
|
|
function editFolder(path, title, description, matureContent = false, moreInfoUrl = '', hasImages = false) {
|
2024-12-30 22:36:47 +01:00
|
|
|
|
document.getElementById('editPath').value = path;
|
2025-01-03 14:33:31 +01:00
|
|
|
|
document.getElementById('edit_name').value = decodeURIComponent(title);
|
|
|
|
|
document.getElementById('edit_description').value = decodeURIComponent(description);
|
2024-12-30 23:41:42 +01:00
|
|
|
|
document.getElementById('edit_mature_content').checked = matureContent;
|
2025-01-03 14:33:31 +01:00
|
|
|
|
document.getElementById('edit_more_info_url').value = decodeURIComponent(moreInfoUrl);
|
|
|
|
|
|
|
|
|
|
// Récupérer le champ URL
|
|
|
|
|
const moreInfoUrlField = document.getElementById('edit_more_info_url_field');
|
|
|
|
|
|
|
|
|
|
// Convertir hasImages en booléen explicitement
|
|
|
|
|
const showUrlField = hasImages === true || hasImages === 'true';
|
|
|
|
|
|
|
|
|
|
// Afficher ou masquer le champ URL
|
|
|
|
|
if (moreInfoUrlField) {
|
|
|
|
|
console.log('Found field, setting display to:', showUrlField ? 'block' : 'none');
|
|
|
|
|
moreInfoUrlField.style.display = showUrlField ? 'block' : 'none';
|
|
|
|
|
|
|
|
|
|
// Si le champ est masqué, on vide aussi sa valeur
|
|
|
|
|
if (!showUrlField) {
|
|
|
|
|
document.getElementById('edit_more_info_url').value = '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.log('Field not found');
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-30 22:36:47 +01:00
|
|
|
|
document.getElementById('editFolderModal').style.display = 'block';
|
2025-01-03 14:33:31 +01:00
|
|
|
|
|
|
|
|
|
// Debug
|
|
|
|
|
console.log('Edit folder:', {
|
|
|
|
|
path,
|
|
|
|
|
hasImages,
|
|
|
|
|
showUrlField,
|
|
|
|
|
fieldFound: !!moreInfoUrlField
|
|
|
|
|
});
|
2024-12-30 22:36:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteFolder(path) {
|
|
|
|
|
document.getElementById('deletePath').value = path;
|
|
|
|
|
document.getElementById('deleteFolderModal').style.display = 'block';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function closeModal() {
|
|
|
|
|
document.getElementById('createFolderModal').style.display = 'none';
|
|
|
|
|
document.getElementById('editFolderModal').style.display = 'none';
|
|
|
|
|
document.getElementById('deleteFolderModal').style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.onclick = function(event) {
|
|
|
|
|
if (event.target.classList.contains('modal')) {
|
|
|
|
|
closeModal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2025-01-06 16:54:32 +01:00
|
|
|
|
<button class="scroll-top" title="Retour en haut">↑</button>
|
|
|
|
|
<script>
|
|
|
|
|
const scrollBtn = document.querySelector('.scroll-top');
|
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
|
scrollBtn.style.display = window.scrollY > 500 ? 'flex' : 'none';
|
|
|
|
|
});
|
|
|
|
|
scrollBtn.addEventListener('click', () => {
|
|
|
|
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2025-01-05 21:55:22 +01:00
|
|
|
|
<?php include 'footer.php'; ?>
|
2024-12-30 20:17:45 +01:00
|
|
|
|
</body>
|
|
|
|
|
</html>
|