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
+14 -2
View File
@@ -961,10 +961,17 @@ switch ($action) {
case 5:
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$articles->saveDraftOverlay($uuid, [
$overlayFields = [
'seo_title' => trim($_POST['seo_title'] ?? ''),
'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');
exit;
}
@@ -979,6 +986,8 @@ switch ($action) {
$published = (bool)($draft['published'] ?? false);
$published_at = $draft['published_at'] ?? '';
$category = $draft['category'] ?? '';
$existingFiles = $articles->getFiles($uuid);
$article = $draft;
include BASE_PATH . '/templates/wizard/step5.php';
break;
@@ -1014,6 +1023,9 @@ switch ($action) {
if ((bool)($draftData['published'] ?? false) !== (bool)($article['published'] ?? false)) {
$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)) : '';
$title = $draftData['title'] ?? '';
$seoTitle = $draftData['seo_title'] ?? '';