mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
test: add ShareLinkTest + PureLogicTest (TDD), fix coverMap undefined in SearchController
This commit is contained in:
46
app/public/language-autre-fragment.php
Normal file
46
app/public/language-autre-fragment.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* language-autre-fragment.php
|
||||
*
|
||||
* HTMX fragment: returns the "Autre(s) langue(s)" input row when no standard
|
||||
* language checkbox is checked, or an empty hidden placeholder when at least
|
||||
* one is checked.
|
||||
*
|
||||
* Expected POST:
|
||||
* languages[] — selected language IDs (may be absent)
|
||||
* language_autre — current free-text value (for repopulation)
|
||||
*/
|
||||
require_once __DIR__ . '/../bootstrap.php';
|
||||
|
||||
$selectedIds = isset($_POST['languages']) && is_array($_POST['languages'])
|
||||
? $_POST['languages']
|
||||
: [];
|
||||
$currentValue = htmlspecialchars(trim($_POST['language_autre'] ?? ''));
|
||||
$anyChecked = !empty($selectedIds);
|
||||
?>
|
||||
<div id="language-autre-row">
|
||||
<?php if (!$anyChecked): ?>
|
||||
<div>
|
||||
<label for="language_autre">Autre(s) langue(s) : <span class="asterisk">*</span></label>
|
||||
<div>
|
||||
<input type="text"
|
||||
id="language_autre"
|
||||
name="language_autre"
|
||||
value="<?= $currentValue ?>"
|
||||
required>
|
||||
<small>Si votre TFE contient une langue absente de la liste, précisez-la ici.</small>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div>
|
||||
<label for="language_autre">Autre(s) langue(s) :</label>
|
||||
<div>
|
||||
<input type="text"
|
||||
id="language_autre"
|
||||
name="language_autre"
|
||||
value="<?= $currentValue ?>">
|
||||
<small>Si votre TFE contient une langue absente de la liste, précisez-la ici.</small>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user