mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
- Add Database::getThesesListCount(array $filters) — runs the same WHERE clauses as getThesesList() but with COUNT(DISTINCT t.id); used to compute total pages without loading all rows. - Extend Database::getThesesList() with $limit/$offset parameters; when $limit > 0 appends LIMIT/OFFSET and re-binds positional params individually to avoid the PDO mixed-style restriction. - Fix getThesesList() SELECT: add LEFT JOIN access_types + at.name as access_type — the column was referenced in the template but never fetched. - Wire admin/index.php: read ?page=, compute $totalPages/$offset, pass $perPage=25 + $offset to getThesesList(); include pagination.php partial below the table with filter-preserving $baseParams. - Add result-count line (<p class="admin-list-meta">) showing "X–Y sur Z TFE" when multiple pages exist. - Add .admin-body .pagination-wrap / .pagination-btn / .pagination-info styles to admin.css (scoped to .admin-body to avoid colliding with public pages).
2.6 KiB
2.6 KiB
PHP Components (Reusable Partials)
Form field partials — templates/partials/form/
text-field.php— accepts$name,$label,$value,$required,$placeholder,$hint; renders the<div>…<label>…<input>…<small>pattern used ~15 times acrossadd.phpandedit.phpselect-field.php— accepts$name,$label,$options[],$selected,$required; renders<div>…<label>…<select>…</div>pattern used ~6 timescheckbox-list.php— accepts$name,$label,$options[],$checked[]; renders the checkbox group pattern (languages, formats) used ~4 times acrossadd.phpandedit.phpfile-field.php— accepts$name,$label,$accept,$hint,$multiple; renders file input pattern used 3 timesjury-fieldset.php— entire jury composition fieldset + JS duplicated verbatim betweenadd.phpandedit.php; extract into one partial accepting$juryPresident,$juryPromoteur,$juryPromoteurExt,$juryLecteurs[]
Shared UI partials — templates/partials/
pagination.php— partial created and used in bothsearch.phpand (now)admin/index.php;admin/index.phpalso gained proper server-side pagination (25/page) with filter-aware$baseParamsstatus-badge.php— published/pending badge + access badge pattern repeated inindex.phpadmin table rows; extract into a partialadmin-alert.php— rename/mergeflash-messages.phpto also handle the 3 different legacy flash key patterns ($_SESSION['error'],$_SESSION['admin_error'],$_SESSION['edit_error'], etc.) that pages still consume manually instead of viaApp::consumeFlash()
Controller Extraction (In Progress)
- Extract
SearchController— most complex public page - Extract
SystemController— biggest single-file win, 500→8 lines - Extract
ThesisEditController— mergesedit.php+actions/edit.php, deduplicates jury fieldset - Extract remaining controllers one by one
- Consolidate action handlers into controller methods
- Unify flash message keys project-wide to
_flash_error/_flash_success - Move OG tag construction into controller logic
- Extract inline CSS/JS from
system.phpinto separate assets
Backend Maintenance
RateLimituses per-file JSON on disk — consider switching to APCu or SQLite; at minimum move cache dir to/tmporstorage/cache/excluded from deploy rsyncapropos.phpcontacts and credits are hardcoded — names, roles, emails (Laurent Leprince, Xavier Gorgol, Brigitte Ledune) live in PHP/HTML; move into theaboutpage Markdown or a config array