mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Refactor HTMX fragment architecture: DRY split into auth endpoints + shared templates
- Created templates/partials/form/_licence.php (shared HTML, no auth logic)
- Created templates/partials/form/_format-website.php (shared HTML, no auth logic)
- Created src/FragmentRenderer.php helper for clean fragment rendering
- Created public/{admin,partage}/fragments/ subdirectories
- Created thin fragment endpoint files: auth guard + data fetch + render template
- Updated all hx-post references in templates to new fragments/ paths
- Updated partage/index.php routing for new fragments subdirectory
- Kept old fragment files as thin delegates for backward compat
- Updated nginx config: added PHP handler in /partage/ location block
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* language-autre-fragment.php (admin)
|
||||
*
|
||||
* HTMX fragment: returns the "Autre(s) langue(s)" input row.
|
||||
* Called from the shared form partial when a language checkbox changes.
|
||||
*
|
||||
* Expected POST:
|
||||
* languages[] — selected language IDs (may be absent)
|
||||
* language_autre — current free-text value (for repopulation)
|
||||
* Admin fragment: language-autre asterisk toggle (HTMX partial).
|
||||
* @deprecated Use /admin/fragments/language-autre.php instead.
|
||||
*/
|
||||
require_once __DIR__ . '/../../bootstrap.php';
|
||||
require_once __DIR__ . '/../../src/AdminAuth.php';
|
||||
|
||||
AdminAuth::requireLogin();
|
||||
|
||||
require_once APP_ROOT . '/public/partage/language-autre-fragment.php';
|
||||
require_once __DIR__ . '/fragments/language-autre.php';
|
||||
|
||||
Reference in New Issue
Block a user