mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 11:39:18 +02:00
- Create app/public/index.php as front controller (bootstrap + Dispatcher) - Rewrite app/router.php for PHP dev server → all non-asset requests to index.php - Update Dispatcher to render full page layouts (head+header+view+footer) - Move public view templates into templates/public/ (home, search, tfe, about, repertoire) - Delete dead direct-access public/*.php files (apropos, search, tfe, licence, repertoire) - Add clean URL routes to Dispatcher (/search, /tfe, /repertoire, /apropos, /licence, /media) - Remove .php extensions from all internal links (header, views, templates, URLs) - Update OG tags in controllers to use clean URLs - Update nginx posterg.conf → front-controller try_files pattern, block direct .php access - Update header.php and search-bar.php form actions to clean URLs - Switch AboutController nav key from 'nav' to 'currentNav' for consistency
68 lines
3.1 KiB
PHP
68 lines
3.1 KiB
PHP
<?php if ($validationError): ?>
|
|
<div class="search-error">⚠ <?= htmlspecialchars($validationError) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Filter controls -->
|
|
<form class="search-controls" method="GET" action="/search">
|
|
<input type="hidden" name="query" value="<?= htmlspecialchars($_GET['query'] ?? '') ?>">
|
|
|
|
<label class="search-filter-label" for="filter-year">Année
|
|
<select class="search-filter-select" name="year" id="filter-year">
|
|
<option value="">Toutes</option>
|
|
<?php foreach ($years as $y): ?>
|
|
<option value="<?= (int)$y ?>" <?= (isset($_GET['year']) && $_GET['year'] == $y) ? 'selected' : '' ?>>
|
|
<?= (int)$y ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</label>
|
|
|
|
<label class="search-filter-label" for="filter-orientation">Orientation
|
|
<select class="search-filter-select" name="orientation" id="filter-orientation">
|
|
<option value="">Toutes</option>
|
|
<?php foreach ($orientations as $o): ?>
|
|
<option value="<?= htmlspecialchars($o['name']) ?>"
|
|
<?= (isset($_GET['orientation']) && $_GET['orientation'] == $o['name']) ? 'selected' : '' ?>>
|
|
<?= htmlspecialchars($o['name']) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</label>
|
|
|
|
<label class="search-filter-label" for="filter-ap">AP
|
|
<select class="search-filter-select" name="ap_program" id="filter-ap">
|
|
<option value="">Tous</option>
|
|
<?php foreach ($apPrograms as $ap): ?>
|
|
<option value="<?= htmlspecialchars($ap['name']) ?>"
|
|
<?= (isset($_GET['ap_program']) && $_GET['ap_program'] == $ap['name']) ? 'selected' : '' ?>>
|
|
<?= htmlspecialchars($ap['name']) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</label>
|
|
|
|
<button type="submit" class="search-apply-btn">Filtrer</button>
|
|
<a href="/search?query=<?= urlencode($_GET['query'] ?? '') ?>" class="search-reset-link">Réinitialiser</a>
|
|
</form>
|
|
|
|
<main class="search-main" id="main-content">
|
|
<output class="search-results-header" role="status"><?= $totalItems ?> résultat<?= $totalItems > 1 ? 's' : '' ?></output>
|
|
|
|
<?php if (!empty($results)): ?>
|
|
<ul class="results-grid">
|
|
<?php foreach ($results as $item): ?>
|
|
<li><a href="/tfe?id=<?= (int)$item['id'] ?>" class="result-card">
|
|
<span class="result-card__authors"><?= htmlspecialchars($item['authors'] ?? '') ?></span>
|
|
<span class="result-card__title"><?= htmlspecialchars($item['title']) ?></span>
|
|
<small class="result-card__meta"><?= htmlspecialchars($item['year']) ?><?php if (!empty($item['orientation'])): ?> · <?= htmlspecialchars($item['orientation']) ?><?php endif; ?></small>
|
|
</a></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
|
|
<?php include APP_ROOT . '/templates/partials/pagination.php'; ?>
|
|
|
|
<?php else: ?>
|
|
<p class="search-empty">Aucun résultat pour cette recherche.</p>
|
|
<?php endif; ?>
|
|
</main>
|