import font locale en test

This commit is contained in:
Fred Tempez 2022-03-31 14:57:50 +02:00
parent fe15df439b
commit fa2e4b2be0

View File

@ -941,6 +941,7 @@ if ($this->getData(['core', 'dataVersion']) < 11400) {
if (is_array($files)) {
$this->deleteData(['fonts', 'files']);
foreach ($files as $fontId => $fontName) {
if (file_exists(self::DIR_DATA . 'fonts' . $fontName)) {
$this->setData(['fonts', 'files', $fontId, [
'name' => ucfirst($fontId),
'font-family'=> $fontId . ', sans-serif',
@ -948,6 +949,20 @@ if ($this->getData(['core', 'dataVersion']) < 11400) {
]]);
}
}
}
// Consersion des fontes importées
// Conversion des fontes locales
$imported = $this->getData(['fonts', 'imported']);
if (is_array($imported)) {
$this->deleteData(['fonts', 'imported']);
foreach ($imported as $fontId => $fontName) {
$this->setData(['fonts', 'imported', $fontId, [
'name' => $fontId,
'font-family'=> $fontId . ', sans-serif',
'resource' => 'https:\/\/fonts.cdnfonts.com\/css\/' . $fontId
]]);
}
}
// Rafraichir les thèmes
if (file_exists(self::DATA_DIR . 'admin.css')) {