<?php
/**
 * language-autre-fragment.php
 *
 * Shared HTMX fragment include: returns the requirement asterisk for the
 * "Autre(s) langue(s)" label. When no standard language checkbox is checked,
 * an asterisk is rendered to signal the field is required (server-side validated).
 *
 * Included by:
 *   - /admin/language-autre-fragment.php  (AdminAuth gated)
 *   - partage/index.php special route     (public, session already booted)
 *
 * Expected POST:
 *   languages[]      — selected language IDs (may be absent)
 */

$selectedIds  = isset($_POST['languages']) && is_array($_POST['languages'])
    ? $_POST['languages']
    : [];
$anyChecked   = !empty($selectedIds);
?>
<span id="language-autre-required"><?= !$anyChecked ? ' <span class="asterisk">*</span>' : '' ?></span>
