$vDomaine . '/ajax_promoteur_hub.php', 'preloaderWait' => $strWait, 'i18n' => [ 'ajaxError' => $strAjaxError, ], ]; } /** Config injectée dans window.MS1_V2_INSCR_GESTION avant inscr-gestion.js */ function fxV2InscrGestionConfig($strLangue) { global $vDomaine; $strLangue = ($strLangue === 'en') ? 'en' : 'fr'; return [ 'domain' => $vDomaine, 'lang' => $strLangue, // MSIN-4401 — true = OCR dossard via serveur (Vision), pas Tesseract local. 'bibOcrCloud' => function_exists('fxInscrGestionBibOcrCloudEnabled') ? (bool)fxInscrGestionBibOcrCloudEnabled() : false, 'preloaderWait' => afficheTexte('preloader_wait', 0, 0, 1), 'refundCancelHint' => function_exists('fxInscrGestionT') ? fxInscrGestionT('inscr_gestion_refund_cancel_hint') : '', 'loginMessages' => [ 'txt_login' => function_exists('fxInscrGestionT') ? fxInscrGestionT('inscr_gestion_login_err_user') : '', 'txt_password' => function_exists('fxInscrGestionT') ? fxInscrGestionT('inscr_gestion_login_err_pass') : '', ], // MSIN-4401 — libellés Info injectés (pas de FR/EN en dur dans le JS). 'i18n' => function_exists('fxInscrGestionT') ? [ 'errLoad' => fxInscrGestionT('inscr_gestion_err_load'), 'errNetwork' => fxInscrGestionT('inscr_gestion_err_network'), 'errRefund' => fxInscrGestionT('inscr_gestion_err_refund'), 'refundOk' => fxInscrGestionT('inscr_gestion_refund_ok'), 'bibOcrNotConfigured' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_not_configured') : fxInscrGestionT('inscr_gestion_bib_ocr_not_configured'), 'bibOcrVisionPrefix' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_vision_prefix') : fxInscrGestionT('inscr_gestion_bib_ocr_vision_prefix'), 'bibOcrImageInvalid' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_image_invalid') : fxInscrGestionT('inscr_gestion_bib_ocr_image_invalid'), 'bibOcrNetwork' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_ocr_network') : fxInscrGestionT('inscr_gestion_bib_ocr_network'), 'bibOcrUnreadable' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_invalid') : fxInscrGestionT('inscr_gestion_bib_scan_invalid'), 'bibScanScanning' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_scanning') : '', 'bibScanLoading' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_loading') : '', 'bibScanReady' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_ready') : '', 'bibScanFound' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_found') : '', 'bibScanFoundSearch' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_found_search') : '', 'bibScanInvalid' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_bib_scan_invalid') : '', 'bibScanCamera' => function_exists('fxInscrGestionScanLabel') ? fxInscrGestionScanLabel('inscr_gestion_qr_camera_error') : '', ] : [], ]; } /** À appeler dans inc_footer.php après inc_footer_scripts.php */ function fxV2RenderFooterScripts() { global $MS1_V2_SCRIPTS, $vDomaine, $strLangue; if (empty($MS1_V2_SCRIPTS) || !is_array($MS1_V2_SCRIPTS)) { return; } $mapFiles = [ 'bib-assignments' => '/js/v2/bib-assignments.js', 'inscr-gestion' => '/js/v2/inscr-gestion.js', 'promoteur-hub' => '/js/v2/promoteur-hub.js', ]; if (in_array('promoteur-hub', $MS1_V2_SCRIPTS, true)) { $cfg = fxV2PromoteurHubConfig($strLangue ?? 'fr'); echo '' . "\n"; } if (in_array('inscr-gestion', $MS1_V2_SCRIPTS, true)) { $cfg = fxV2InscrGestionConfig($strLangue ?? 'fr'); echo '' . "\n"; } foreach ($MS1_V2_SCRIPTS as $strName) { if (!isset($mapFiles[$strName])) { continue; } $strSrc = htmlspecialchars($vDomaine . $mapFiles[$strName], ENT_QUOTES, 'UTF-8'); echo '' . "\n"; } } }