mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
src/ThesisEditController.php (285 lines) centralises all data-fetching and
mutation logic for the thesis-edit workflow:
load(int $thesisId): array
Fetches the thesis row, current language/format/jury selections, and all
lookup tables (orientations, AP programmes, finality types, languages,
formats, licences, access types) in one call. Returns a flat view-variable
array that the dispatcher extracts directly.
save(int $thesisId, array $post, array $files): void
Runs the full edit inside a transaction: thesis metadata, authors, jury,
languages, formats, tags. Banner upload/removal is handled outside the
transaction (filesystem op). Rolls back and re-throws on any failure.
static autofocusFieldForError(string $msg): ?string
Centralises the WCAG 3.3.1 exception-message → field-name mapping that
was previously duplicated inline in actions/edit.php.
Dispatcher changes:
admin/edit.php 191 → 162 lines (pure view + ThesisEditController::create() + load())
actions/edit.php 153 → 53 lines (CSRF guard + ThesisEditController::save() call)
Follows the same pattern as SearchController and SystemController.
TODO Index
Pending tasks split by topic. Completed tasks have been removed.
| File | Topic |
|---|---|
| 01-css-semantic-refactor.md | CSS class audit, semantic HTML for templates (public + admin), inline style extraction, favicon |
| 02-php-components.md | Form field partials, shared UI partials, controller extraction, backend maintenance |
| 03-system-cache.md | system_cache table, SystemCache class, system.php refactor |
| 04-accessibility.md | WCAG 2.1 AA — remaining failures grouped by success criterion |