mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
feat: extract MediaController, wire into Dispatcher, delete media.php
This commit is contained in:
48
app/public/licence.php
Normal file
48
app/public/licence.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../bootstrap.php';
|
||||
require_once APP_ROOT . '/src/Database.php';
|
||||
require_once APP_ROOT . '/src/Parsedown.php';
|
||||
|
||||
$currentNav = 'licence';
|
||||
|
||||
try {
|
||||
$db = Database::getInstance();
|
||||
$dbPage = $db->getPage('licenses');
|
||||
$content = $dbPage ? $dbPage['content'] : '';
|
||||
$licencePageTitle = $dbPage ? $dbPage['title'] : 'Licences';
|
||||
} catch (Exception $e) {
|
||||
error_log("Error loading licence page: " . $e->getMessage());
|
||||
$content = '';
|
||||
$licencePageTitle = 'Licences';
|
||||
}
|
||||
|
||||
$pd = new Parsedown();
|
||||
$pd->setSafeMode(true);
|
||||
$html = $pd->text($content);
|
||||
|
||||
$pageTitle = $licencePageTitle . ' – Posterg';
|
||||
$metaDescription = 'Informations sur les licences d\'utilisation des mémoires publiés sur Posterg, le répertoire des TFE de l\'erg.';
|
||||
$ogTags = [
|
||||
'type' => 'website',
|
||||
'title' => $pageTitle,
|
||||
'description' => $metaDescription,
|
||||
'url' => 'https://posterg.erg.be/licence.php',
|
||||
'site_name' => 'Posterg – ERG',
|
||||
];
|
||||
$extraCss = ['/assets/css/apropos.css'];
|
||||
$bodyClass = 'apropos-body';
|
||||
?>
|
||||
<?php include APP_ROOT . '/templates/head.php'; ?>
|
||||
<?php include APP_ROOT . '/templates/header.php'; ?>
|
||||
|
||||
<main class="apropos-main" id="main-content">
|
||||
<div class="prose apropos-single">
|
||||
<?php if (!empty(trim($content))): ?>
|
||||
<?= $html ?>
|
||||
<?php else: ?>
|
||||
<p>Contenu à venir.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include APP_ROOT . '/templates/footer.php'; ?>
|
||||
Reference in New Issue
Block a user