Files
xamxam/todo/02-php-components.md
Pontoporeia c3a02e0aaa system.php: extract inline JS and style= attrs into separate assets
Move the ~130-line $extraJsInline heredoc from admin/system.php into a
static file public/assets/js/system.js, loaded via $extraJs so the
template footer emits a normal <script src=…>.

Replace 4 inline style= attributes with named CSS modifier classes in
system.css:
  - style="margin:0;border:none;padding:0" on .srv-section-title
    → .srv-section-title--compact
  - style="margin-bottom:.75rem" on sub-heading <h3>
    → .srv-section-title--sub
  - style="margin-bottom:0" on .php-grid
    → .php-grid--flush
  - style="font-size:.84rem;color:var(--text-secondary)" on <label>
    → .log-toolbar label rule in system.css

The one remaining inline style (--disk-pct / --disk-color CSS custom
properties on .disk-bar) is intentionally kept: it carries PHP runtime
values that cannot be expressed in a static stylesheet.
2026-04-06 15:33:08 +02:00

2.9 KiB

PHP Components (Reusable Partials)

Form field partials — templates/partials/form/

  • text-field.php — already implemented; used across add.php and edit.php for all single-line fields
  • select-field.php — already implemented; used for orientation, ap, finality, license, access type, etc.
  • checkbox-list.php — already implemented with <fieldset>/<legend class="sr-only">/<ul> structure for WCAG 1.3.1
  • file-field.php — already implemented; used for cover image, banner, and TFE files
  • 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/

  • 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
  • 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
  • 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 — all callers already use App::flash(); removed dead legacy-key fallback chains (error, admin_error, edit_error, form_error, success, admin_success, edit_success) from consumeFlash()
  • Move OG tag construction into controller logic
  • Extract inline CSS/JS from system.php into separate assets — JS moved to public/assets/js/system.js (loaded via $extraJs); 4 inline style= attributes replaced with CSS classes; only dynamic CSS custom properties (--disk-pct, --disk-color) remain as inline styles because they carry PHP runtime values

Backend Maintenance

  • RateLimit cache dir — already in storage/cache/rate_limit; justfile deploy excludes storage/cache/* from rsync. APCu/SQLite migration deferred (not blocking).
  • 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