feat : image de couverture modifiable en mode édition (v1.6.12)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 23:08:14 +02:00
parent 6092cf940d
commit 88cc67d945
4 changed files with 23 additions and 4 deletions
+7
View File
@@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag
--- ---
## [1.6.12] - 2026-05-15
### Ajouté
- Wizard édition — étape SEO : sélecteur d'**image de couverture** (og:image) désormais affiché en mode édition (était limité à la création) — sélection parmi les fichiers images existants, appliquée immédiatement via `setCover()` et mémorisée dans le draft overlay
---
## [1.6.11] - 2026-05-15 ## [1.6.11] - 2026-05-15
### Corrigé ### Corrigé
+14 -2
View File
@@ -961,10 +961,17 @@ switch ($action) {
case 5: case 5:
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$articles->saveDraftOverlay($uuid, [ $overlayFields = [
'seo_title' => trim($_POST['seo_title'] ?? ''), 'seo_title' => trim($_POST['seo_title'] ?? ''),
'seo_description' => trim($_POST['seo_description'] ?? ''), 'seo_description' => trim($_POST['seo_description'] ?? ''),
]); ];
$coverFile = trim($_POST['cover_file'] ?? '');
if ($coverFile !== '' && $coverFile !== ($draft['cover'] ?? '')) {
$articles->setCover($uuid, $coverFile);
$updatedCover = $articles->getByUuid($uuid)['cover'] ?? $coverFile;
$overlayFields['og_image'] = rtrim(APP_URL, '/') . '/file?uuid=' . rawurlencode($uuid) . '&name=' . rawurlencode($updatedCover);
}
$articles->saveDraftOverlay($uuid, $overlayFields);
header('Location: /edit/' . rawurlencode($uuid) . '/6'); header('Location: /edit/' . rawurlencode($uuid) . '/6');
exit; exit;
} }
@@ -979,6 +986,8 @@ switch ($action) {
$published = (bool)($draft['published'] ?? false); $published = (bool)($draft['published'] ?? false);
$published_at = $draft['published_at'] ?? ''; $published_at = $draft['published_at'] ?? '';
$category = $draft['category'] ?? ''; $category = $draft['category'] ?? '';
$existingFiles = $articles->getFiles($uuid);
$article = $draft;
include BASE_PATH . '/templates/wizard/step5.php'; include BASE_PATH . '/templates/wizard/step5.php';
break; break;
@@ -1014,6 +1023,9 @@ switch ($action) {
if ((bool)($draftData['published'] ?? false) !== (bool)($article['published'] ?? false)) { if ((bool)($draftData['published'] ?? false) !== (bool)($article['published'] ?? false)) {
$changes[] = ($draftData['published'] ?? false) ? 'article publié' : 'article dépublié'; $changes[] = ($draftData['published'] ?? false) ? 'article publié' : 'article dépublié';
} }
if (($draftData['og_image'] ?? '') !== ($article['og_image'] ?? '')) {
$changes[] = 'image de couverture modifiée';
}
$autoRevisionComment = !empty($changes) ? ucfirst(implode(', ', $changes)) : ''; $autoRevisionComment = !empty($changes) ? ucfirst(implode(', ', $changes)) : '';
$title = $draftData['title'] ?? ''; $title = $draftData['title'] ?? '';
$seoTitle = $draftData['seo_title'] ?? ''; $seoTitle = $draftData['seo_title'] ?? '';
+1 -1
View File
@@ -1 +1 @@
1.6.11 1.6.12
+1 -1
View File
@@ -98,7 +98,7 @@ $_catVal = trim($category ?? '');
</div> </div>
</div> </div>
<?php if ($mode === 'create' && !empty($existingFiles ?? [])): ?> <?php if (!empty($existingFiles ?? [])): ?>
<?php $_imgFiles = array_filter($existingFiles, fn ($_f) => $_f['is_image']); ?> <?php $_imgFiles = array_filter($existingFiles, fn ($_f) => $_f['is_image']); ?>
<?php if ($_imgFiles): ?> <?php if ($_imgFiles): ?>
<div class="mb-0"> <div class="mb-0">