From 7417b932de36417515051f43a392aa3196549b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 21 Mar 2022 18:25:54 +0100 Subject: [PATCH] warning type vide --- core/module/theme/theme.php | 57 +++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 5971c475..39c562a8 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -578,36 +578,37 @@ class theme extends common { // Parcourir les fontes disponibles et construire le tableau pour le formulaire foreach ($f as $type => $typeValue) { - - foreach ($typeValue as $fontId => $fontValue) { - // Fontes utilisées par les thèmes - $fontUsed[$fontId] = ''; - foreach ($used as $key => $value) { - if ( $value === $fontId) { - $fontUsed[$fontId] .= $key . '
'; + if (is_array($typeValue)) { + foreach ($typeValue as $fontId => $fontValue) { + // Fontes utilisées par les thèmes + $fontUsed[$fontId] = ''; + foreach ($used as $key => $value) { + if ( $value === $fontId) { + $fontUsed[$fontId] .= $key . '
'; + } } + self::$fontsDetail [] = [ + $fontId, + '' . $f[$type][$fontId]['name'] . '' , + $f[$type][$fontId]['font-family'], + $fontUsed[$fontId], + $type, + $type !== 'websafe' ? template::button('themeFontEdit' . $fontId, [ + 'class' => 'themeFontEdit', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/fontEdit/' . $type . '/' . $fontId . '/' . $_SESSION['csrf'], + 'value' => template::ico('pencil'), + 'disabled' => !empty($fontUsed[$fontId]) + ]) + : '', + $type !== 'websafe' ? template::button('themeFontDelete' . $fontId, [ + 'class' => 'themeFontDelete buttonRed', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/fontDelete/' . $type . '/' . $fontId . '/' . $_SESSION['csrf'], + 'value' => template::ico('cancel'), + 'disabled' => !empty($fontUsed[$fontId]) + ]) + : '' + ]; } - self::$fontsDetail [] = [ - $fontId, - '' . $f[$type][$fontId]['name'] . '' , - $f[$type][$fontId]['font-family'], - $fontUsed[$fontId], - $type, - $type !== 'websafe' ? template::button('themeFontEdit' . $fontId, [ - 'class' => 'themeFontEdit', - 'href' => helper::baseUrl() . $this->getUrl(0) . '/fontEdit/' . $type . '/' . $fontId . '/' . $_SESSION['csrf'], - 'value' => template::ico('pencil'), - 'disabled' => !empty($fontUsed[$fontId]) - ]) - : '', - $type !== 'websafe' ? template::button('themeFontDelete' . $fontId, [ - 'class' => 'themeFontDelete buttonRed', - 'href' => helper::baseUrl() . $this->getUrl(0) . '/fontDelete/' . $type . '/' . $fontId . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel'), - 'disabled' => !empty($fontUsed[$fontId]) - ]) - : '' - ]; } } sort(self::$fontsDetail);