From 3f52396e9dbe02ea7c30727694abe875334404c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Thu, 31 Mar 2022 15:03:13 +0200 Subject: [PATCH] import des fontes WIP --- core/include/update.inc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 4e92dc3e..61740e49 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -934,7 +934,6 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { 'resource' => 'https://fonts.cdnfonts.com/css/vollkorn' ] ]; - $this->setData(['fonts', 'imported', $fonts]); // Conversion des fontes locales $files = $this->getData(['fonts', 'files']); @@ -950,20 +949,22 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { } } } - // Consersion des fontes importées - // Conversion des fontes locales + // Consersion des fontes importées $imported = $this->getData(['fonts', 'imported']); if (is_array($imported)) { $this->deleteData(['fonts', 'imported']); - foreach ($imported as $fontId => $fontName) { + foreach ($imported as $fontId => $fontUrl) { $this->setData(['fonts', 'imported', $fontId, [ 'name' => $fontId, - 'font-family'=> $fontId . ', sans-serif', - 'resource' => 'https:\/\/fonts.cdnfonts.com\/css\/' . $fontId + 'font-family'=> '"' . $fontId . '", sans-serif', + 'resource' => 'https:\/\/fonts.cdnfonts.com\/css\/' . $fontUrl ]]); } } + + $this->setData(['fonts', 'imported', $fonts]); + // Rafraichir les thèmes if (file_exists(self::DATA_DIR . 'admin.css')) { unlink (self::DATA_DIR . 'admin.css');