warning type vide

This commit is contained in:
Fred Tempez 2022-03-21 18:25:54 +01:00
parent 93595a53ca
commit 7417b932de

View File

@ -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 . '<br/>';
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 . '<br/>';
}
}
self::$fontsDetail [] = [
$fontId,
'<span style="font-family:' . $f[$type][$fontId]['font-family'] . '">' . $f[$type][$fontId]['name'] . '</span>' ,
$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,
'<span style="font-family:' . $f[$type][$fontId]['font-family'] . '">' . $f[$type][$fontId]['name'] . '</span>' ,
$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);