" . $value . ""; } return $return; } /** * Enregistre un message d'erreur lié à un champ de formulaire. * * @param string $_string Le champ de formulaire en erreur. * @return void */ public static function recErrorInput(string $_string) { if (empty($_SESSION["alert"]["input"])) { $_SESSION["alert"]["input"] = array(); } array_push($_SESSION["alert"]["input"], $_string); } /** * Vérifie si un champ de formulaire est en erreur. * * @param string $_string Le champ de formulaire à vérifier. * @return bool TRUE si le champ est en erreur, FALSE sinon. */ public static function ifErrorInput(string $_string) { return (in_array($_string, $_SESSION["alert"]["input"])) ? TRUE : FALSE; } /** * Affiche une alerte sous forme de toast. * * @param string $_idAlert L'ID de l'alerte. * @param string $_style Le style CSS de l'alerte. * @param string $_icon L'icône de l'alerte. * @param array|null $_texte Le texte de l'alerte. * @return void */ private static function printToast(string $_idAlert, string $_style, string $_icon, ?array $_texte = NULL) { $text = ($_texte != NULL) ? self::printAlert($_texte) : NULL; echo '
'; } /** * Affiche toutes les alertes enregistrées. * * @return void */ public static function show() { historique::recordLogs(); echo '