migrate apropos data from config/apropos.php to SQLite

- Create apropos_contents table via migration 010
- Add Database methods: getAproposContent(), saveAproposContent(), getAllAproposContents()
- Replace admin/pages.php with admin/contenus.php (renamed header from 'Pages statiques' to 'Contenus')
- Replace admin/pages-edit.php with admin/contenus-edit.php (support editing pages + apropos contents)
- Create admin/actions/apropos.php for saving apropos data (contacts, credits, erg_url)
- Update public/apropos.php to read contacts/credits/erg_url from DB
- Delete config/apropos.php
This commit is contained in:
Pontoporeia
2026-04-16 13:44:06 +02:00
parent 4158c72d08
commit bf30aab0b3
15 changed files with 538 additions and 236 deletions

View File

@@ -319,8 +319,23 @@ CREATE TABLE IF NOT EXISTS pages (
INSERT OR IGNORE INTO pages (slug, title, content) VALUES
('charte', 'Charte', 'Contenu à venir'),
('about', 'À propos', 'Contenu à venir'),
('licenses', 'Licences', 'Contenu à venir'),
('contact', 'Contact', 'Contenu à venir');
('licenses', 'Licences', 'Contenu à venir');
-- ============================================================================
-- APROPOS CONTENTS (structured data for the "À propos" page)
-- ============================================================================
CREATE TABLE IF NOT EXISTS apropos_contents (
id INTEGER PRIMARY KEY AUTOINCREMENT,
key TEXT NOT NULL UNIQUE, -- 'contacts', 'credits', 'erg_url'
value TEXT, -- JSON array or plain string
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
INSERT OR IGNORE INTO apropos_contents (key, value) VALUES
('contacts', '[{"name":"Laurent Leprince","role":"Bibliothèque d''architecture, d''ingénierie architecturale, d''urbanisme (BAIU) :","email":"laurent.leprince@uclouvain.be"},{"name":"Xavier Gorgol","role":"Responsable des mémoires de l''ERG :","email":"xavier.gorgol@erg.be"},{"name":"Brigitte Ledune","role":"Cours de suivi de mémoire :","email":"brigitte.ledune@erg.be"}]'),
('credits', '[{"label":"Design & développement","value":"Olivia Marly, Théophile Gerveau-Mercie & Théo Hennequin"},{"label":"Typographies","value":"Ductus (Amélie Dumont) & BBB DM Sans"}]'),
('erg_url', 'https://erg.be');
-- ============================================================================
-- INDEXES for performance
@@ -365,6 +380,12 @@ CREATE TRIGGER IF NOT EXISTS update_pages_timestamp
AFTER UPDATE ON pages
BEGIN
UPDATE pages SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
END
CREATE TRIGGER IF NOT EXISTS update_apropos_contents_timestamp
AFTER UPDATE ON apropos_contents
BEGIN
UPDATE apropos_contents SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
END;
-- ============================================================================