<?php
require_once __DIR__ . "/../../bootstrap.php";
require_once __DIR__ . '/../../src/AdminAuth.php';
AdminAuth::requireLogin();
require_once __DIR__ . '/../../src/Database.php';

$pageTitle = "Contenus";

try {
    $db = new Database();
    $pages = $db->getAllPages();
    $aproposKeys = $db->getAllAproposContents();
} catch (Exception $e) {
    error_log("Error loading contenus: " . $e->getMessage());
    die("Erreur lors du chargement des contenus.");
}

$isAdmin = true; $bodyClass = 'admin-body';
require_once APP_ROOT . '/templates/head.php';
include APP_ROOT . '/templates/header.php';
include APP_ROOT . '/templates/admin/contenus.php';
require_once APP_ROOT . '/templates/admin/footer.php';
