diff --git a/arbre.php b/arbre.php index 752cb96..217b57e 100644 --- a/arbre.php +++ b/arbre.php @@ -19,8 +19,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($path && $newName) { $newPath = $path . '/' . sanitizeFilename($newName); if (!file_exists($newPath)) { + $moreInfoUrl = $_POST['more_info_url'] ?? ''; mkdir($newPath, 0755, true); - $infoContent = $newName . "\n" . $description . "\n" . $matureContent; + $infoContent = $newName . "\n" . $description . "\n" . $matureContent . "\n" . $moreInfoUrl; file_put_contents($newPath . '/infos.txt', $infoContent); $_SESSION['success_message'] = "Dossier créé avec succès."; } else { @@ -28,10 +29,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } break; - + case 'edit_folder': if ($path && isSecurePath($path)) { - $infoContent = $newName . "\n" . $description . "\n" . $matureContent; + $moreInfoUrl = $_POST['more_info_url'] ?? ''; + $infoContent = $newName . "\n" . $description . "\n" . $matureContent . "\n" . $moreInfoUrl; $infoPath = $path . '/infos.txt'; if (file_put_contents($infoPath, $infoContent) !== false) { $_SESSION['success_message'] = "Dossier modifié avec succès."; @@ -104,7 +106,7 @@ function generateTree($path, $currentPath) { } $output .= ''; $output .= '
'; - $output .= ''; + $output .= ''; $output .= ''; $output .= '
'; } @@ -130,7 +132,22 @@ function generateTree($path, $currentPath) { if (!$hasSubfolders) { $output .= '🖼️'; } - $output .= ''; + // Pour les dossiers avec des images + if (!$hasSubfolders) { + $output .= ''; + } else { + // Pour les dossiers sans images + $output .= ''; + } if (!hasImages($fullPath)) { $output .= ''; } @@ -199,6 +216,10 @@ function generateTree($path, $currentPath) { +
+ + +
+
@@ -236,6 +261,10 @@ function generateTree($path, $currentPath) { ⚠️
+
+ + +
@@ -263,15 +292,45 @@ function generateTree($path, $currentPath) {