Files
xamxam/todo/02-php-components.md
Pontoporeia 4c3f71b6e4 Extract apropos contacts/credits to config/apropos.php
Names, roles, emails, and credits on the À propos page were hardcoded
directly in apropos.php HTML. To update a contact meant editing a
template file — risky for non-developers and easy to introduce a typo
or broken mailto link.

Changes:
- config/apropos.php: new config array with erg_url, contacts[] (name,
  role, email per person) and credits[] (label/value pairs); follows
  the same pattern as config/admin_credentials.php
- public/apropos.php: loads config via require; aside section now loops
  over $apropos['contacts'] and $apropos['credits'] with htmlspecialchars
  throughout; hardcoded HTML strings removed entirely

Also audited todo/02-php-components.md and marked 8 stale items as done:
all 5 form field partials were already implemented and in use, the
flash-message consolidation was already handled by App::consumeFlash(),
and the RateLimit cache dir was already at storage/cache/rate_limit
(excluded from deploy rsync).
2026-04-06 15:33:08 +02:00

32 lines
2.4 KiB
Markdown

# PHP Components (Reusable Partials)
## Form field partials — `templates/partials/form/`
- [x] **`text-field.php`** — already implemented; used across `add.php` and `edit.php` for all single-line fields
- [x] **`select-field.php`** — already implemented; used for orientation, ap, finality, license, access type, etc.
- [x] **`checkbox-list.php`** — already implemented with `<fieldset>/<legend class="sr-only">/<ul>` structure for WCAG 1.3.1
- [x] **`file-field.php`** — already implemented; used for cover image, banner, and TFE files
- [x] **`jury-fieldset.php`** — already implemented; single partial shared by `add.php` and `edit.php`; includes all WCAG aria-labels and JS for dynamic rows
## Shared UI partials — `templates/partials/`
- [x] **`pagination.php`** — partial created and used in both `search.php` and (now) `admin/index.php`; `admin/index.php` also gained proper server-side pagination (25/page) with filter-aware `$baseParams`
- [x] **`status-badge.php`** — partial fully implemented (`templates/partials/status-badge.php`) with `$badgeType`/`$badgeValue` API; CSS rules in `admin.css`; used in `admin/index.php` for publish + access badges
- [x] **`admin-alert.php`** — already done; `flash-messages.php` calls `App::consumeFlash()` which handles all legacy key variants (`_flash_error`, `error`, `admin_error`, `edit_error`, `form_error`, `success`, `admin_success`, `edit_success`) and clears them all
## Controller Extraction (In Progress)
- [ ] Extract `SearchController` — most complex public page
- [ ] Extract `SystemController` — biggest single-file win, 500→8 lines
- [ ] Extract `ThesisEditController` — merges `edit.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.php` into separate assets
## Backend Maintenance
- [x] **`RateLimit` cache dir** — already in `storage/cache/rate_limit`; `justfile` deploy excludes `storage/cache/*` from rsync. APCu/SQLite migration deferred (not blocking).
- [x] **`apropos.php` contacts and credits** — moved to `config/apropos.php` config array (`contacts[]`, `credits[]`, `erg_url`); `apropos.php` loops over the config with `htmlspecialchars`; update names/emails by editing only the config file